我正在开发一个使用require.js来加载脚本的超文本标记语言应用程序。我有一个主页,它是使用jquery load()加载的。
我想知道我们是否可以使用require.js加载html页面。
发布于 2013-11-08 04:55:12
文本插件就是你的朋友。请参阅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.
}
);https://stackoverflow.com/questions/18791058
复制相似问题