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:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old July 29th, 2004, 09:46 PM
bigredfish bigredfish is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 bigredfish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Open NEW window from popup AND auto-close

I can program your firewall and track down viruses & trojans with ease, but I suck when it comes to Javascript.

Things currently work fine:
I have a popup that opens when the homepage loads. When you click inside the popup, it auto-closes the popup and refreshes the "opener" or homepage to the new link.

NOW client wants to open a NEW page from the popup link, while keeping the homepage OPEN, and still auto-closing the popup.

Here's my existing code from inside the popup:

<a href="javascript:;" onclick="opener.location='http://www.ohsonline.com/enews.html';self.close()"><IMG
SRC="ohsnewpopupart.jpg" ALIGN="TOP" WIDTH="230" HEIGHT="300" BORDER="0" HSPACE="0"
VSPACE="0"></A><br><br><center><A HREF="javascript.parent.parent.close()"><FONT SIZE="-1" FACE="arial"
COLOR="#FFFFFF"><b>close this window</b></FONT></A><br><br></center>

So how can I get the link to open a NEW page ??????(such as target=new_window)


mike

Reply With Quote
  #2  
Old July 29th, 2004, 10:42 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
I hope the popup doesn't contain anything important, because any browser worth its salt should be blocking annoying popups.

Regardless, you need to write a function that utilises "window.open" in the popup, and call this when the user clicks a link in the popup.
Code:
function openLinkClosePopup(url) {
    x = window.open(url,'newWinName','features')
    self.close()
  }
 
 '-- call the func like this
 <a href="#" onclick="openLinkClosePopup('http://www.foo.com')">Open another annoying popup</a>
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old July 30th, 2004, 08:27 AM
bigredfish bigredfish is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 bigredfish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Not sure I understand what value I'm looking for in "x" ??

Reply With Quote
  #4  
Old July 30th, 2004, 10:29 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
how about you try the code and see what happens....

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Open NEW window from popup AND auto-close


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 | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway