Accessing variables of one javascript file in another javascript file

Posted by Ragha under JavaScript on 6/9/2008 | Views : 7201 | Status : [Member] | Replies : 3
i have one file in which i declared a variable and the value is set in the same file

i would like to use this variable in another javacsript file

how to do this

any help would be appreciated

thanks
sudha




Responses

Posted by: SheoNarayan on: 6/10/2008 [Administrator] HonoraryPlatinum

Up
0
Down
You can directly use that variable provided the variable scope is page level (not declared inside any function).

Thanks and let me know if it works.

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Ragha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ragha on: 6/10/2008 [Member] Starter

Up
0
Down
i have used the same approach but not working

Ragha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Parag737 on: 11/21/2008 [Member] Starter

Up
0
Down
ya it's working but make sure that those variable contains file is included in html before another file in which you want to acess .

Ragha, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response