Problem of duplicate function names: When 2 same type of JS loaded in 1 Page

H

hemant.singh

I am stuck with strange JS issue

My product gives user to show some images(which track mouseover) on
page by embedding script like
<script src=http://domain.com/GetDynamicJS?domagic=1>
</script>

Now user is embedding more than of the above and when user mouse over's
the image output of first1 than function getting called is script
loaded in last ... thus error, as that script don't have the relevant
data for it ...
Any solution for ?
Following possible solutions look feasible to me?
1) Somehow I get a static variable and all the JS loaded from my domain
will keep data in that static variable, how to implement it, im not
sure :)
2) This is crude, but how about I dynamically give method names of
events in script such that there are no duplicate function names, but
this will again bring lot of other complexity and might need usuage of
eval which is evil and I'll look some option for not using it rather


TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top