Yos@WDF
11-26-2002, 12:45 AM
Is it possible to access javascript variable accross the page? When we popup the new window is it possible from new popup window to access javascript variable declare in opener window?
|
Click to See Complete Forum and Search --> : Is it possible to access javascript variable accross the page? Yos@WDF 11-26-2002, 12:45 AM Is it possible to access javascript variable accross the page? When we popup the new window is it possible from new popup window to access javascript variable declare in opener window? Rick Bull 11-26-2002, 03:28 AM As long as you haven't declared the variable inside a function: <script type="text/javascript"><!-- var someVar; //Accessible in other scripts function someFunction() { var anotherVar; //Not accessible } //--></script> ThaLyric 11-26-2002, 03:30 AM Yes it's possible to declare a variable and use it somewhere on your page. Example <html> <head> <script> var test="hello"; </script> </head> <body> This is HTML <br> <script> document.write(test); </script> </body> </html> ---------- It's also possible to get the value of a variable on the caller page. Don't know how anymore ( use to do it ). But webreference.com had some articles about it. Maybe you search the site ... if my memeory serves my right the article had also a topic about modal windows .... Hopes this helps ... Yos@WDF 11-27-2002, 05:52 AM Thank for your suggestion. I've found that if we use showModalDialog function we can do it. But another problem is in my popup window i've a form inside but when i submit the form it's alway open the new window. But i want it to reuse that popup window not open the one. So anyone have any opinion about this, please let me know. Thank in advance webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |