«javascript» 태그된 질문

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


5
AngularJS : HTTP 인터셉터에 서비스 주입 (순환 종속성)
AngularJS 앱에서 인증을 처리하기 위해 HTTP 인터셉터를 작성하려고합니다. 이 코드는 작동하지만 Angular가 이것을 자동으로 처리해야한다고 생각했기 때문에 서비스를 수동으로 주입하는 것이 걱정됩니다. app.config(['$httpProvider', function ($httpProvider) { $httpProvider.interceptors.push(function ($location, $injector) { return { 'request': function (config) { //injected manually to get around circular dependency problem. var AuthService = $injector.get('AuthService'); console.log(AuthService); console.log('in …


2
요청 페이로드를 검색하는 방법
PHP , ExtJS 및 ajax store를 사용 하고 있습니다 . POST 또는 GET이 아닌 데이터 (생성, 업데이트, 삭제시)를 보냅니다. 에서 크롬 콘솔 나는 "에서 JSON으로 보내는 PARAMS를 참조 요청 페이로드 "필드. $ _POST 및 $ _GET 이 비어 있습니다. PHP에서 검색하는 방법?
118 php  javascript  json  extjs 


6
NodeJS의 JavaScript OOP : 어떻게?
Java에서와 같이 고전적인 OOP에 익숙합니다. NodeJS를 사용하여 JavaScript에서 OOP를 수행하는 모범 사례는 무엇입니까? 각 클래스는 module.export? 수업은 어떻게 만드나요? this.Class = function() { //constructor? var privateField = "" this.publicField = "" var privateMethod = function() {} this.publicMethod = function() {} } vs. (정확한지도 모르겠습니다) this.Class = { privateField: "" , …

11
Angular 2 형제 구성 요소 통신
ListComponent가 있습니다. ListComponent에서 항목을 클릭하면 해당 항목의 세부 정보가 DetailComponent에 표시되어야합니다. 둘 다 동시에 화면에 표시되므로 라우팅이 필요하지 않습니다. ListComponent에서 클릭 한 항목을 DetailComponent에게 어떻게 알립니 까? 부모 (AppComponent)까지 이벤트를 생성하는 것을 고려했으며 부모가 @Input을 사용하여 DetailComponent에 selectedItem.id를 설정하도록했습니다. 또는 관찰 가능한 구독으로 공유 서비스를 사용할 수 있습니다. 편집 : …

8
Moment.js : 날짜 사이의 날짜
주어진 날짜가 두 날짜 사이에 있으면 Moment.js로 감지하려고합니다. 버전 2.0.0 이후, 팀 추가 isBefore()및 isAfter()날짜 비교합니다. isBetween()방법 이 없기 때문에 이것이 효과가 있다고 생각했습니다. var date = moment("15/02/2013", "DD/MM/YYYY"); var startDate = moment("12/01/2013", "DD/MM/YYYY"); var endDate = moment("15/01/2013", "DD/MM/YYYY"); if (date.isBefore(endDate) && date.isAfter(startDate) || (date.isSame(startDate) || date.isSame(endDate)) ) { alert("Yay!"); …

4
JavaScript window.location에 target =“_ blank”를 추가하는 방법은 무엇입니까?
다음은 대상을로 설정합니다 _blank. if (key == "smk") { window.location = "http://www.smkproduction.eu5.org"; target = "_blank"; done = 1; } 그러나 이것은 작동하지 않는 것 같습니다. 새 탭에서 링크를 시작하려면 어떻게합니까? 내 코드는 다음과 같습니다. function ToKey() { var done = 0; var key = document.tokey.key.value; key = key.toLowerCase(); if (key …
118 javascript 

6
ECMAScript 란 무엇입니까?
Visual Studio에서 스크립트 유형을 JavaScript로 설정할 때 이것은 intellisense의 옵션으로 나타납니다. 빠른 Google 검색에서 절름발이 결과가 나왔기 때문에 이것이 사용하기에별로 인기가 없다고 생각했습니다. 뭐야? 누구든지 그것을 사용합니까? (<script type="text/ecmascript">) 왜?
118 javascript 


7
Momentjs로 어제 날짜를 얻는 방법?
그래서 제 질문은 간단합니다. MomentJs와 어제 날짜를 어떻게 얻습니까? Javascript에서는 매우 간단합니다. today = new Date(); yesterday = new Date(today.setDate(today.getDate() - 1)) console.log(yesterday) 그러나 MomentJs로 어떻게 이것을 달성합니까?

1
Babel 7로 업그레이드 : null의 '바인딩'속성을 읽을 수 없습니다.
다음 명령을 실행 하여 Babel 7 (6에서)로 업그레이드했습니다 . npm remove babel-cli npm install --save-dev @babel/cli @babel/core @babel/preset-env 내 .babelrc파일 은 다음과 같습니다 . { "presets": ["env"] } 그런 다음 실행했습니다. babel js/src --out-dir js/dist 결과는 다음과 같습니다. TypeError: Cannot read property 'bindings' of null at Scope.moveBindingTo (/xyz/node_modules/@babel/traverse/lib/scope/index.js:867:13) at BlockScoping.updateScopeInfo …

16
'정의되지 않은 속성을 읽을 수 없음'오류를 방지하는 방법은 무엇입니까?
내 코드에서는 여러 개체가 서로 중첩 된 항목이있는 배열을 다루지 만 일부는 그렇지 않습니다. 다음과 같이 보입니다. // where this array is hundreds of entries long, with a mix // of the two examples given var test = [{'a':{'b':{'c':"foo"}}}, {'a': "bar"}]; 때때로 배열을 반복해야하고 불일치로 인해 다음과 같은 오류가 발생하기 …
118 javascript 


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