«javascript» 태그된 질문

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


9
반응 :“this”는 컴포넌트 함수 안에서 정의되지 않았다
class PlayerControls extends React.Component { constructor(props) { super(props) this.state = { loopActive: false, shuffleActive: false, } } render() { var shuffleClassName = this.state.toggleActive ? "player-control-icon active" : "player-control-icon" return ( <div className="player-controls"> <FontAwesome className="player-control-icon" name='refresh' onClick={this.onToggleLoop} spin={this.state.loopActive} /> <FontAwesome className={shuffleClassName} name='random' onClick={this.onToggleShuffle} /> </div> ); } onToggleLoop(event) { // "this …
152 javascript  reactjs  this 



7
새 파일이나 삭제 된 파일에 대해 gulp.watch가 트리거되지 않습니까?
glob 일치에서 파일을 편집 할 때 다음 Gulpjs 작업이 제대로 작동합니다. // watch task. gulp.task('watch', ['build'], function () { gulp.watch(src + '/js/**/*.js', ['scripts']); gulp.watch(src + '/img//**/*.{jpg,jpeg,png,gif}', ['copy:images']); gulp.watch(src + '/less/*.less', ['styles']); gulp.watch(src + '/templates/**/*.{swig,json}', ['html']); }); // build task. gulp.task('build', ['clean'], function() { return gulp.start('copy', 'scripts', 'less', 'htmlmin'); }); 그러나 …
151 javascript  node.js  gulp 

7
순환 객체 값을 포함하는 직렬화 객체
다른 노드에 대한 참조 인 하위 노드가 포함 된 객체 (구문 트리)가 있습니다. 내가 사용하는,이 객체를 직렬화하고 싶습니다 JSON.stringify(),하지만 난 얻을 TypeError : 순환 객체 값 내가 언급 한 구성 때문에 이 문제를 어떻게 해결할 수 있습니까? 다른 노드에 대한 이러한 참조가 직렬화 된 오브젝트에 표시되는지 여부는 중요하지 않습니다. 반면에 …

18
jQuery로 iframe 다시로드
한 페이지에 두 개의 iframe이 있고 하나는 다른 하나를 변경하지만 다른 iframe은 새로 고칠 때까지 변경 사항을 표시하지 않습니다. 이 iframe을 jQuery로 쉽게 새로 고칠 수 있습니까? <div class="project"> <iframe id="currentElement" class="myframe" name="myframe" src="http://somesite.com/something/new"></iframe> </div>

6
Google 차트에서 패딩 또는 여백 제거
// Load the Visualization API and the piechart package. google.load('visualization', '1.0', {'packages':['corechart']}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawChart); // Callback that creates and populates a data table, // instantiates the pie chart, passes in the data and // draws it. function drawChart() …

3
Chrome 확장 메시지 전달 : 응답이 전송되지 않음
콘텐츠 스크립트와 확장 프로그램 사이에 메시지를 전달하려고합니다. 내용 스크립트에서 내가 가진 것입니다 chrome.runtime.sendMessage({type: "getUrls"}, function(response) { console.log(response) }); 그리고 백그라운드 스크립트에서 chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if (request.type == "getUrls"){ getUrls(request, sender, sendResponse) } }); function getUrls(request, sender, sendResponse){ var resp = sendResponse; $.ajax({ url: "http://localhost:3000/urls", method: 'GET', success: function(d){ …

11
3 개의 함수를 차례로 호출하려면 어떻게해야합니까?
이 함수를 하나씩 호출해야하는 경우 $('#art1').animate({'width':'1000px'},1000); $('#art2').animate({'width':'1000px'},1000); $('#art3').animate({'width':'1000px'},1000); jQuery에서 다음과 같은 작업을 수행 할 수 있다는 것을 알고 있습니다. $('#art1').animate({'width':'1000px'},1000,'linear',function(){ $('#art2').animate({'width':'1000px'},1000,'linear',function(){ $('#art3').animate({'width':'1000px'},1000); }); }); 그러나 jQuery를 사용하지 않고 전화를 걸고 싶다고 가정 해 봅시다. some_3secs_function(some_value); some_5secs_function(some_value); some_8secs_function(some_value); 실행하기 위해이 함수를 호출하고 호출이 some_3secs_function끝난 후 실행 한 다음 some_5secs_function호출이 종료 된 …



8
열거 가능한 것은 무엇을 의미합니까?
MDN의 for..in 페이지 에서 "for..in은 객체의 열거 가능한 속성을 반복합니다."라고 말했습니다. 그런 다음 "Enumerable properties는 for..in 루프에 의해 반복 될 수있는 속성입니다."라는 속성 의 열거 및 소유권 페이지로 이동했습니다. 사전은 열거 가능한 것을 계산 가능한 것으로 정의하지만 그 의미를 실제로 시각화 할 수는 없습니다. 열거 가능한 것의 예를 얻을 수 …

8
누군가 Javascript에서 "디 바운스"기능을 설명 할 수 있습니까?
Javascript의 "debouncing"함수에 관심이 있습니다. http://davidwalsh.name/javascript-debounce-function 불행히도 코드는 내가 이해할 정도로 명확하게 설명되어 있지 않습니다. 누구나 그것이 어떻게 작동하는지 알아낼 수 있습니까? (아래에 의견을 남겼습니다). 요컨대 나는 이것이 실제로 어떻게 작동하는지 이해하지 못한다. // Returns a function, that, as long as it continues to be invoked, will not // be triggered. …


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