You may have a need to use jQuery to read HTML that you’ve stored in a file and then insert it into the DOM somewhere. Here’s how:
- Create a file named myfile.html and add some simple HTML

- In your .js file, include the following code:
if($('#myelement').length == 0) {
$.get("/" + window.location.pathname.split("/")[1] + "/files/custom/myfile.html", function(data) {
$(document.body).append(data);
});
}