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?