This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes namespace of javascript function ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "namespace of javascript function ?" Watch "namespace of javascript function ?" New topic

namespace of javascript function ?

Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
In my html page, when it calls a javascript function, I believe it looks through the imported javascript files one by one to find out the function name that matches to the one in the html. What if there are two identical function names defined in two different javascript that are both imported into this html ? Will the first found one be invoked or what ? Is there a way I can specify which javascript file I want the code to search for that function name ?

Thank you.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60752

It is invalid to have two names in the same global namespace that are the same. Don't do that.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: namespace of javascript function ?
Similar Threads
JQuery for Displaying Dynamic Labels such as Hotmails' Email Recipients?
jQuery selector using array of objects
How to edit javascript in firefox 3.6
Javascript function isn't returning a value
frame function