Solved

JavaScript functions with the same name

Posted on 2015-02-19
1
59 Views
Last Modified: 2015-02-20
How do you call a JavaScript function that is defined  in more than one library?
Is there a namespace associated with the function?
0
Comment
Question by:metro156
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 22

Accepted Solution

by:
ambience earned 500 total points
ID: 40620766
You cant, there can only be one function with a name. However, you can do  something like


<script src="script1.js" />
<script>

    var module1 =  {
          func = SomeFuncWithName;
    };
</script>
<script src="script2.js" />
<script>

    var module2=  {
          func = SomeFuncWithName;
    };

    // call first func
    module1.func();

    // call second
    module2.func();
</script>

Open in new window

0

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
This article discusses how to create an extensible mechanism for linked drop downs.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question