Javascript: Opening a New Window: Help needed

Discussion in 'Web Design & Programming' started by blade, Aug 5, 2007.

  1. blade

    blade GEEK 2.0

    Likes Received:
    0
    Trophy Points:
    0
    im trying to have javascript in my header, so i dont have to re-type the attributes on every page i want a pop-up, so far this is what i have, but its not working..

    code to put in header..
    code to put on any page..
     
  2. Matt555

    Matt555 iMod

    Likes Received:
    98
    Trophy Points:
    48
  3. blade

    blade GEEK 2.0

    Likes Received:
    0
    Trophy Points:
    0
    thanks, but the problem was solved from anothr forum, here is the code..

    Code:
    <script type="text/javascript">
    /*<![CDATA[*/
    function win(width,height,url) {
    var myfloater=window.open(url,'','scrollbars=yes,toolbar=no,resizable=yes,status=no,width='+width+',height='+height+',top='+((screen.availHeight/2)-(height/2))+',left='+((screen.availWidth/2)-(width/2))+',directories=no');
    }
    /*]]>*/
    </script>
    
    
    
    <a href="http://www.domain.com/content.html" onclick="win(600,400,this.href); return false;">launch</a>
    
     

Share This Page