I’m wanting to use a bunch of client-side EJS (or jQuery) HTML Templates in the browser, and I’m wondering if anyone has any suggestions for how to organize them. I definitely don’t want to mix them into the JavaScript or HTML, and I don’t want to have to make additional AJAX requests just to get them from the server. Once I have them loaded into JS variables, I will cache them using HTML5’s local storage. Thoughts anyone?
Thanks!
Personally I either load them as JSON object
$.getJSON()with ajax call or simply write them in hidden text area divs inside htmlMost HTML editors tolerate this without messing up the syntax checking.