nat*_*ton 6 javascript require node.js
当我尝试在节点中使用 require 加载 js 文件时,出现错误“找不到模块‘ http://bit.ly/ProjectRedBoard ’”。这是我试图执行的代码,
var content = require("http://bit.ly/ProjectRedBoard");
content.run();
Run Code Online (Sandbox Code Playgroud)
所以基本上我做错了什么还是需要能够加载在线文件?
问候, Techhead55
编辑:该链接现已折旧,最终代码如下
var XMLHttpRequest = require("xhr2");
var xhr = new XMLHttpRequest();
xhr.onload = function (){
eval(xhr.responseText);
};
xhr.open("get", "https://googledrive.com/host/0BxIYopGUx_PROTIyOVo3ZEYtWW8/run.js", true);
xhr.send();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2050 次 |
| 最近记录: |