|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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>
|
|
#3
|
|||
|
|||
|
Not sure I understand what value I'm looking for in "x" ??
|
|
#4
|
||||
|
||||
|
how about you try the code and see what happens....
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Open NEW window from popup AND auto-close |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|