weixin_33674437 2015-05-18 01:45 采纳率: 0%
浏览 26

导入没有AJAX的HTML?

I recently finished a web plugin that has a tool composed of around 350 lines of HTML markup. I have stored such in a GUI.html file. I am able to load this file with jQuery's $("#some.element").load("GUI.html"); as long as I'm not testing locally.

However, since this plugin is meant to be used by others, I think is too much of a pain to not be able to test locally, so I got around this by storing the markup in a string in a JavaScript file:

// GUI.js
MyPlugin.GUI = "<div id='some.markup'></div>...';

This works since loading scripts is not restricted locally in browsers such as Chrome (while XMLHttpRequests are).

Is there any other less intrusive way to load the HTML file without having to turn it into an ugly string that will be cumbersome to edit later?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥170 如图所示配置eNSP
    • ¥20 docker里部署springboot项目,访问不到扬声器
    • ¥15 netty整合springboot之后自动重连失效
    • ¥15 悬赏!微信开发者工具报错,求帮改
    • ¥20 wireshark抓不到vlan
    • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
    • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
    • ¥15 stata安慰剂检验作图但是真实值不出现在图上
    • ¥15 c程序不知道为什么得不到结果
    • ¥15 键盘指令混乱情况下的启动盘系统重装