Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] window.onload questions
- From: schalk at volume4.com (Schalk)
- Subject: [Javascript] window.onload questions
- Date: Tue Dec 6 13:52:07 2005
Nick Fitzsimons wrote: >> Greetings All >> >> I have two seperate .js file that I load into a html page. Both of them >> load their init() function with the window.onload function. From what I >> can see it seems that the second script is overriding the first script >> and the first one is never run and therefore does not function. >> >> First, can I call the onload functions of both in the second script, >> even though they are in seperate files? If not, is it best then to merge >> the two into one file or do I have another option? Thanks for all of >> your input. >> >> > > You can semi-automate the process using Simon Willison's addLoadEvent > function; it's described at > <http://simon.incutio.com/archive/2004/05/26/> and he goes into more > detail at > <http://www.sitepoint.com/blogs/2004/05/26/closures-and-executing-javascript-on-page-load/> > > HTH, > > Nick. > Thank you all for the input. The functions does have seperate names so it should then be ok as to load both in the second script. If not, I will have a look at the technique from Simon. -- Kind Regards Schalk Neethling Web Developer.Designer.Programmer.President Volume4.Business.Solution.Developers
- References:
- [Javascript] window.onload questions
- From: Schalk
- [Javascript] window.onload questions
- From: Nick Fitzsimons
- [Javascript] window.onload questions
- Prev by Date: [Javascript] window.onload questions
- Next by Date: [Javascript] Closing multiple child windows
- Previous by thread: [Javascript] window.onload questions
- Next by thread: [Javascript] window.onload questions
- Index(es):