Dynamically loaded User Controls - same .JS file....problem

J

james

OK - I have a user control that I have written. I load it multiple
times on the same page with different data. It uses a server side
javascript file that contains some DHTML / JS. The problem appears to
be that since each instance of the control shares the same .JS file,
there appears to be collisions where one control is overwriting values
in the .JS that was set by the other control.

Is there some way to have each user control have its own instance of
the same JS file?


Any help greatly appreciated!
 
J

james

Do you mean in the server-side javascript file?

instead of:

var oThing;

initialize it as:

var oThing = new Object;
 
E

Eliyahu Goldin

You must be talking about variables. Instead off allocating them statically,
create them dynamically with a "new" statement.
 
J

James

james said:
Do you mean in the server-side javascript file?

instead of:

var oThing;

initialize it as:

var oThing = new Object;

To clarify, what I beleive I need is for each user control (there are
two of them dynamically loaded on the page at the same time) to have
its own private instance of the .js file. Possible? Am I all turned
around the axle on this?
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top