Jump to content

Instead of poping up, link try to open a bad page. Why?


ghurty

Recommended Posts

Can someone please explain to me what I am doing wrong here?:

 

I have this script which I have in the html file

<script language="JavaScript">

function newWindow(mypage,myname,w,h,features) {

if(screen.width){

var winl = (screen.width-w)/2;

var wint = (screen.height-h)/2;

}else{winl = 0;wint =0;}

if (winl < 0) winl = 0;

if (wint < 0) wint = 0;

var settings = 'height=' + h + ',';

settings += 'width=' + w + ',';

settings += 'top=' + wint + ',';

settings += 'left=' + winl + ',';

settings += features;

win = window.open(mypage,myname,settings);

win.window.focus();

}

</script>

 

And then I have this link:

<a href="java script:newWindow('../sendemail.php?'+document.location.href,'email',400,350,'')">Tell a Friend</a>

 

But when ever I click on the link, instead of a popup window, I it tries to load a page and I get the following error:

Access Forbidden:

http://localhost/java%20script:newWindow%28%27../sendmail.php?%27+document.location.href,%27email%27,400,350,%27%27%29

 

 

Thanks

  • 2 weeks later...

I haven't read much else but I'm pretty sure its 'javascript:' not 'java script:'

<a href="javascript:newWindow('../sendemail.php?'+document.location.href,'email',400,350,'')">Tell a Friend</a>

 

Not:

<a href="javascript:newWindow('../sendemail.php?'+document.location.href,'email',400,350,'')">Tell a Friend</a>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.