...

View Full Version : Calling variables



David P.
03-12-2009, 05:58 AM
Not sure if this is possible, can you help?
-made a function_1 that sets the value of a variable
-a different site is calling a function_2 in the same .js script
-need function_2 to call the variable that was set in function_1

-basically I need a function to call a variable that was set in another function

is it possible? how do I do this?

Eldarrion
03-12-2009, 06:57 AM
If I understand you correctly, it shouldn't be. Two different sites interacting via variables in JS would be... for lack of a better word, impossible. (Even with global JS variables, the variables are accessible only by the local site)

amars1983
03-12-2009, 04:05 PM
You could place both functions into one external file, link to it from both pages, and just make the variable in the first function that you want in the second global. Hope this helps.

A1ien51
03-12-2009, 04:08 PM
You could place both functions into one external file, link to it from both pages, and just make the variable in the first function that you want in the second global. Hope this helps.

The shared JS file will have two instances of it, the variables can not be shared.

Eric



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum