【发布时间】:2013-09-18 10:06:44
【问题描述】:
我正在开发一个使用 require.js 加载脚本的 Html 应用程序。我有一个使用 jquery load() 加载的主页。
我想知道我们是否可以使用 require.js 加载 html 页面。
【问题讨论】:
标签: requirejs
我正在开发一个使用 require.js 加载脚本的 Html 应用程序。我有一个使用 jquery load() 加载的主页。
我想知道我们是否可以使用 require.js 加载 html 页面。
【问题讨论】:
标签: requirejs
文本插件是你的朋友。请参阅text plugin documentation 或blog post on that topic。
引用前者:
require(["some/module", "text!some/module.html", "text!some/module.css"],
function(module, html, css) {
//the html variable will be the text
//of the some/module.html file
//the css variable will be the text
//of the some/module.css file.
}
);
【讨论】: