Link to home
Start Free TrialLog in
Avatar of evry2004
evry2004

asked on

open a link in pop up onclick

i would like to open a link in pop up onclick with the  onclick event
Avatar of Shahzad Fateh Ali
Shahzad Fateh Ali
Flag of Pakistan image

Hi,

For only external link you can use target='_blank'.

But for a forced popup use the attached function.

// external link
<a href='http://www.google.com/' target='_blank'>Google</a>
 
//forced popup
 
function popup(url,w,h)
{
window.open(url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+w+',height='+h+',screenX=300,screenY=350,top=350,left=300');
}

Open in new window

Avatar of evry2004
evry2004

ASKER

i want to associate the onClick event with the pop up window here is the scenario :
this is the external link i want to promote diasfm.com . whenever user click on the main page of my website the promotion link should pop up actually they are not clicking on the promotion link. it's like cliking on any part of the page will execute the pop up .
ASKER CERTIFIED SOLUTION
Avatar of Shahzad Fateh Ali
Shahzad Fateh Ali
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanx great you went straight to the point