我遵循Douglas Crockford的代码约定,但我无法在Emacs中的JS模式中获得正确的标识.我试图自定义模式的缩进选项,尝试了另外的模式,如js3,但似乎没有任何工作.
当我有括号,我必须打破表达式,Emacs缩进像这样:
this.offices.each(this.addOfficesToMap,
this);
Run Code Online (Sandbox Code Playgroud)
虽然我正在遵循的惯例,但是当表达式被打破时我应该只留下4个空格.因此缩进应如下所示:
this.offices.each(this.addOfficesToMap,
this);
Run Code Online (Sandbox Code Playgroud)
知道我怎么能改变分解表达式的缩进?
似乎 Youtube iframe API 最近在他们的 iframe API 中引入了一个错误。
这是一个错误示例,直接从Youtube iframe 演示页面中提取:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('https://google-developers.appspot.com').
g.C @ www-widgetapi.js:116
g.G @ www-widgetapi.js:113
setInterval (async)
ab @ www-widgetapi.js:89
kb @ www-widgetapi.js:114
W @ www-widgetapi.js:98
Y @ www-widgetapi.js:118
createYTPlayer @ as3_demo_functions.js:385
onYouTubePlayerAPIReady @ as3_demo_functions.js:424
(anonymous) @ www-widgetapi.js:140
(anonymous) @ www-widgetapi.js:140
10:33:24.521
Run Code Online (Sandbox Code Playgroud)
知道如何解决这个问题吗?据说设置origin
应该防止这种情况发生,但似乎他们没有origin
在他们的 JS 中正确使用。