Tutorial :Pop window javascript in not working in IE



Question:

I have a page in which there is a link on clicking of which a pop up window needs to be displayed. This works fine in Firefox, but it does not work in IE. In fact, it displays me HTTP 404 error in a pop up window. Below is the JavaScript and the link with which I execute the JavaScript:

<a href="javascript:NewWindow('artworkspecs.php','Artwork','750','600','0','0');" style="cursor:pointer; font-weight:normal"  title="Recommended Artwork Specifications" rel="nofollow"><b>Recommended Artwork Specifications</b></a>  

JavaScript:

<script language=javascript type="text/javascript">      function NewWindow(page, name, w, h, location, scroll) {          var winl = (screen.width - w) / 2;          var wint = (screen.height - h) / 2;          winprops = 'height='+h+',width='+w+',location='+location+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'          win = window.open(page, name, winprops)          if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }      }  </script>    <script type="text/javascript"><!--      function popupWindow(url) {          window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=420,screenX=150,screenY=150,top=150,left=150')      }  //--></script>  


Solution:1

Try using the fully qualified url for the new window, not just artworkspecs.php


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »