best way to init scripts
best way to init scripts
Hi,
I am making some templates with quite some jQuery now am im currently using "window.onload = function(){" to initialize some scripts after the page has loaded.
The problem now is that i have diffrent templates with diffrent things to initialize, but some stuff is needed all over the app.
My idea was to make a default.js with the default stuff, and including a specific .js per template.
The problem im having now is that when i use "window.onload = function(){" in 2 diffrent JS docs in 1 HTML, only one of them works.
What is the proper way to handle this? Because i dont want redundant JS...
Grtz,
Rich