在外部URL的node.js中包含javascript文件

时间:2015-10-22 00:49:37

标签: javascript node.js express

如何从外部URL中包含/导入node.js中的JavaScript文件?
我尝试了include("http://example.com/script.js");但没有用。我见过Load and execute external js file in node.js with access to local variables。但是我想要包含来自另一个域的脚本。 我希望在HTML中有类似的东西。

<script src="http://example.com/script.js"></script>
<script>
    //do stuff
</script>

我正在使用Express.js。

0 个答案:

没有答案