Javascript Pop Up Help!

Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
SpaceshipSpaceship
Watch

jmills

New Member
Impact
0
Hey... I am a total newbie and Im looking for some quick help. I am trying to create a pop_up for when someone click a link to leave our site. Here is my current code:

function pop_up(){
win = window.open("exit.htm", "", "height=150,width=300", hotkeys="no");
}

The problem is that the message window opens under the window for the link which is also opening in a new window. I want the message window to open and come to the top. Is this possible.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Rather than open the link in a news window why not open it in the same window

function pop_up(){
var url = "http;//www.wiredeyes.com";
window.open("exit.htm", "", "height=150,width=300", hotkeys="no");
window.document.location.href=url;
}

However if you really need it you might be better off trying

function pop_up(){
var url1 = "http;//www.wiredeyes.com";
var url2 = "exit.htm";
window.open(url1)
window.open(url2, "", "height=150,width=300", hotkeys="no");
}

You might also need to add an

onLoad="window.focus();"

to you exit.htm file for good measure.
 
0
Close
Pupups are blocked by most people, I suggest you don't use them.
 
0
Close
onClick popups should be fine.
 
0
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back