ghurty Posted October 20, 2009 Share Posted October 20, 2009 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 Quote Link to comment Share on other sites More sharing options...
ghurty Posted November 2, 2009 Author Share Posted November 2, 2009 Can anyone help please? Thanks Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted November 3, 2009 Share Posted November 3, 2009 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.