![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jul 2005
Posts: 24
OS: Windows XP
|
javascript - duplicate functions
Hi,
Just wondering what would occur in the following scenario; say I have two javascript functions which have the same name. Now one is declared in the <head> region of the HTML code enclosed within the <script></script> tags. The other is within a javascript file that is "included" using the 'src' attribute of the script tag. Refer to example below. HTML Code:
<html> <head> <script type="text/javascript" src="first_file.js"> // Same function also declared within first_file.js function foo() { ... } </script> </head> </html> HTML Code:
<body onLoad="foo()">
Thanks. |
|
|
|
|
|
#2 (permalink) |
|
Cymru am byth
|
Seems to me that it would be because the first_file.js is loaded last, so its still in the Java engine's memory, wiping out the one that was in there before.
__________________
Living with Louie dog's the only way to stay sane _____________________________________________ ... and with those words so begins my lifetime of longing for the devil's warm embrace |
|
|
|
![]() |
| Thread Tools | |
|
|