JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

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 February 1st, 2005, 10:24 AM
jogol jogol is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 2 jogol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 17 m 18 sec
Reputation Power: 0
[solved] cross window scripting

hi experts,

i have a frameset with top, main and bottom frame. a link in the bottom frame opens a popup. the popup contains a link. what i want this link to do is open a page in the main frame of the window below the popup and close the popup.

how can this be done?

Code:
<a href="javascript:;" onclick="opener.location='http://www.domain.com/page.htm';self.close()">Link</a>


the code above doesnt work as it opens the page in the bottom frame (the opener location)

another possibility would be that the link in the popup replaces the frameset in the window below with another frameset and closes the popup. (something like target="_top" in javascript)

any help would be appreciated.

(dont flame me because of the use of frames and popups - it is not my site, i´m just trying to help a buddy out with this problem. the whole website is huge and cant be recoded)

thanks in advance,
jogol

Last edited by jogol : February 2nd, 2005 at 10:03 AM. Reason: problem solved

Reply With Quote
  #2  
Old February 1st, 2005, 12:14 PM
Anibal Anibal is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 176 Anibal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 20 m 48 sec
Reputation Power: 4
Hi!. This is probably not for me (I'm not an expert) I read somewhere you have a parent object (like a document object that references the parent window) If so, you'd have:

window with frames --> frame --> popup

May be you can reference with parent the window with frames and use the location.href property (with the right target also).

If not...sorry, I tried my best to help you!!


Anibal.

Reply With Quote
  #3  
Old February 2nd, 2005, 09:58 AM
jogol jogol is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 2 jogol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 17 m 18 sec
Reputation Power: 0
thx for your help. the solution is to add .parent in order to replace the whole frameset

Code:
<a href="javascript:;" onclick="opener.parent.location='http://www.domain.com/page.htm';self.close()">Link</a>


loading a page in main frame works this way:

Code:
<a href="javascript:;" onclick="opener.parent.frames['main'].location='http://www.domain.com/page.htm';self.close()">Link</a>


greetz

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > cross window scripting


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT