Current location: Hot Scripts Forums » General Web Coding » JavaScript » sharing global variables accross pages


sharing global variables accross pages

Reply
  #1 (permalink)  
Old 05-23-04, 03:39 PM
davidklonski davidklonski is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
sharing global variables accross pages

Hello

I have an HTML page which loads another page inside an IFrame.
Each of the two pages has its own javascript code.

I would like to be able to define one global variable which will be accessed from functions in both scripts.
The variable must be single. That means that if a script in one of the pages changes it, the change will be seen by the scripts in the other page.

Is that possible?

thanks in advance
Reply With Quote
  #2 (permalink)  
Old 05-24-04, 02:06 AM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
You can use window.parent.variable_name to access a variable in the main window from the i-frame.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirection back to a page from form submit DAL Perl 11 03-21-05 02:45 PM
global variables in external file Dr-Leech JavaScript 1 05-15-04 02:28 PM


All times are GMT -5. The time now is 02:21 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.