«javascript» 태그된 질문

ECMAScript (JavaScript / JS)에서의 프로그래밍 및 다양한 방언 / 구현 (ActionScript 제외)에 관한 질문이 있습니다. 이 태그는 거의 사용되지 않지만 [node.js], [jquery], [json] 및 [html] 태그와 가장 관련이 있습니다.

9
DOM 컨테이너를 통해 Highcharts 차트에 액세스하려면 어떻게해야합니까?
highcharts-chart를 div 컨테이너에 렌더링 할 때 div-Container를 통해 차트 개체에 액세스하려면 어떻게해야합니까? 차트 변수를 전역으로 만들고 싶지 않습니다. var chart = new Highcharts.Chart({ chart: { renderTo: "testDivId", ... 함수를 호출하기 위해 위의 컨텍스트 (의사 코드) 외부의 차트에 액세스하고 싶습니다. var chart = Highcharts.Chart("testDivId"); //access from id chart.redraw();

17
클릭시 확인 대화 상자-AngularJS
ng-click사용자 지정 angularjs 지시문을 사용하여 확인 대화 상자를 설정하려고합니다 . app.directive('ngConfirmClick', [ function(){ return { priority: 1, terminal: true, link: function (scope, element, attr) { var msg = attr.ngConfirmClick || "Are you sure?"; var clickAction = attr.ngClick; element.bind('click',function (event) { if ( window.confirm(msg) ) { scope.$eval(clickAction) } }); } }; …


6
.js 파일에 상대적인 각도 지시문 templateUrl
저는 몇 가지 다른 위치에서 사용될 각도 지시문을 만들고 있습니다. 지시문이 사용 된 앱의 파일 구조를 항상 보장 할 수는 없지만 사용자가 동일한 폴더에 directive.js및 directive.html(실제 파일 이름이 아님) 를 넣도록 강제 할 수 있습니다 . 페이지가를 평가할 때는 자체에 상대적인 directive.js것으로 간주합니다 templateUrl. 을 파일에 templateUrl상대적으로 설정할 수 directive.js있습니까? …

9
childNode를 통해 루프
다음과 같이 childNodes를 반복하려고합니다. var children = element.childNodes; children.forEach(function(item){ console.log(item); }); 그러나, 출력 Uncaught TypeError: undefined is not a function에 의한 forEach기능. 나는 또한 children대신 사용하려고 childNodes하지만 아무것도 변경되지 않았습니다. 무슨 일인지 아는 사람 있나요?


8
Javascript로 jQuery로드 및 jQuery 사용
다음을 사용하여 jQuery 라이브러리를 dom에 추가하고 있습니다. var script = document.createElement('script'); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; script.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(script); 그러나 내가 실행할 때 : jQuery(document).ready(function(){... 콘솔이 오류를보고합니다. Uncaught ReferenceError: jQuery is not defined jQuery를 동적으로로드하고 DOM에 있으면 어떻게 사용합니까?


8
브라우저 내 자바 스크립트에 노드 스타일이 필요합니까?
Node와 동일한 유연성 / 모듈성 / 사용 편의성을 제공하는 브라우저 내 자바 스크립트 용 라이브러리가 require있습니까? 더 자세한 정보를 제공하기 위해 : 그 이유 require는 다음과 같습니다. 다른 위치에서 코드를 동적으로로드 할 수 있습니다 (HTML에서 모든 코드를 연결하는 것보다 스타일이 더 좋습니다). 모듈 구축을위한 일관된 인터페이스를 제공합니다. 모듈이 다른 모듈에 …


6
이 요소를 javascript onclick 함수에 전달하고 클릭 한 요소에 클래스를 추가하는 방법
다음과 같은 html 탐색 코드가 있습니다. function Data(string) { //1. get some data from server according to month year etc., //2. unactive all the remaining li's and make the current clicked element active by adding "active" class to the element $('.filter').removeClass('active'); $(this).addClass('active'); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="row" style="padding-left:21px;"> <ul class="nav …

2
TypeScript로 window.location 설정
다음 TypeScript 코드에서 오류가 발생합니다. ///<reference path='../../../Shared/typescript/jquery.d.ts' /> ///<reference path='../../../Shared/typescript/jqueryStatic.d.ts' /> function accessControls(action: Action) { $('#logoutLink') .click(function () { var $link = $(this); window.location = $link.attr('data-href'); }); } 다음에 대해 밑줄이 그어진 빨간색 오류가 발생합니다. $link.attr('data-href'); 메시지 내용 : Cannot convert 'string' to 'Location': Type 'String' is missing property 'reload' …


6
반응 : 조건부로 prop을 컴포넌트에 전달
if 문을 사용하는 것보다 조건부로 prop을 전달하는 더 좋은 방법이 있는지 알고 싶습니다. 예를 들어, 지금은 다음과 같습니다. var parent = React.createClass({ propTypes: { editable: React.PropTypes.bool.isRequired, editableOpts: React.PropTypes.shape({...}) }, render: function() { if(this.props.editable) { return ( <Child editable={this.props.editableOpts} /> ); } else { // In this case, Child will use …

4
Node.js는 Blob을 만들 수 없습니까?
node.js로 작업 중이며 내 오디오를 node.js 서버로 스트리밍했습니다. 이제 오디오 블롭을 작성하는 과정에서 발견했습니다. var audioBlob = new Blob([dataview], { type: 'audio/wav' }); 새 Blob에서 ReferenceError가 발생합니다. Blob이 지원되지 않는 것 같습니다. node.js fs 모듈로 저장하고 싶은 blob을 어떻게 만들 수 있습니까? 감사합니다!

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.