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

Link to comment
Share on other sites

  • 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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.