首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用require.js加载html页面

使用require.js加载html页面
EN

Stack Overflow用户
提问于 2013-09-14 00:29:55
回答 1查看 786关注 0票数 1

我正在开发一个使用require.js来加载脚本的超文本标记语言应用程序。我有一个主页,它是使用jquery load()加载的。

我想知道我们是否可以使用require.js加载html页面。

EN

回答 1

Stack Overflow用户

发布于 2013-11-08 04:55:12

文本插件就是你的朋友。请参阅text plugin documentationblog post on that topic

引用前者的话:

代码语言:javascript
复制
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.
    }
);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18791058

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档