Reputation: 19202
I'm building a file for each 'page' I want to dynamically load. Each 'page' file is implemented using the Singleton Pattern, with pretty much just one public method, loadPage()
or init()
.
Is there a better way to approach this? A framework that I should know of? It's not a complicated app, maybe 3-5pages. It just started to become a real pain document.createElement
-ing several nested div's with JavaScript.
Upvotes: 0
Views: 56
Reputation: 3740
Replace the contents of the body with an assignment to innerHtml and take that HTML from a file inside the app folder.
Upvotes: 1