javascript
justtoomuchforyou
没人在乎。
展开
-
javascript - 闭包 - 几种函数写法
1、function a(){ var n = 0; function inc() { n++; // 获得了父函数的变量n console.log(n); } inc(); inc(); }a(); //调用a, 控制台输出1,再输出22、function a(){ var n = 0; this.inc = functio转载 2017-08-06 23:03:35 · 309 阅读 · 0 评论 -
javascript - 闭包
1、(http://www.jb51.net/article/83524.htmfunction createFunctions(){ var result = new Array(); document.writeln("a"); for (var i = 0; i < 10; i++){ document.writeln("p"); result[i] = f转载 2017-08-06 22:29:33 · 171 阅读 · 0 评论 -
jQuery无法读取本地文件
浏览器报错XMLHtmlRequest cannot load file:///C.xxxxxxx .Cross origin resources are only supported for protocol schemes!就是不能跨域访问。解决办法:关闭浏览器,在cmd到此浏览器exe的目录下,运行命令:[浏览器exe文件名] --allow-file-access-from...原创 2017-10-31 01:36:01 · 2148 阅读 · 0 评论