Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 20th, 2002, 12:35 AM
visualdensity visualdensity is offline
Absolut Bummer
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Jungle
Posts: 51 visualdensity User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Passing Variables from Child Window to Parent Window using Javascript

Hi all.....

I'm trying to pass a variable from a child window to the parent window. How do I do this?

I roughly know how do do this... eg using opener.something ... but I don't understand it conceptually...

Can anyone be kind enough to help me with this?

Any explaination is deeeply appreciated. I'm tired of searching for it over the web.

__________________


Reply With Quote
  #2  
Old December 20th, 2002, 08:09 AM
dgibson dgibson is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Urbana, MD, USA
Posts: 66 dgibson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
I just answered something similar a few weeks ago

Make sure you've set the var in teh parent window already. Then you can reassign its value from a child window with

opener.varname="new value"

Hope that helps.

Reply With Quote
  #3  
Old December 20th, 2002, 07:38 PM
visualdensity visualdensity is offline
Absolut Bummer
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Jungle
Posts: 51 visualdensity User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Kewll... thanks a lot for that! I'll give it a go and see how it goes...

Extra question:
I just don't quite understand that conceptually...

Ok... if I set the variable in the parent...

Quote:
function popColor(chosenColor) {
alert('Chosen color: ' + chosenColor);
}



Then in the child, if I dump the chosen color from a form into the variable.....

Quote:
chosenColor = document.form1.colors.value;
opener.popColor(chosenColor);



will it pop up in the parent window immediately or do I have to refresh it first?

Sorry if I don't look like I know what I'm doing... I'm a newbie in Javascript.

Thanks again.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Passing Variables from Child Window to Parent Window using Javascript


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap