Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Little JavaScript Problem

Options
  • 06-10-2005 10:01pm
    #1
    Registered Users Posts: 3,514 ✭✭✭


    I'm in the middle of adding a little piece of js to a site that is under construction at the moment but i'm having a problem when i add javascript to create a new pop up window...Here is the code, i put all the code that i've added to the page in bold, the code works perfect without it but once its added it all goes pear shaped. If anyone can spot the problem please let me know. Nice one!

    <script language="JavaScript1.1">
    <!--
    var image1=new Image()
    image1.src="getimage-1.jpg"
    var image2=new Image()
    image2.src="newmello.gif"
    var image3=new Image()
    image3.src="poster064.jpg"
    var image4=new Image()
    image4.src="poster065.jpg"
    var image5=new Image()
    image5.src="getimage.jpg"
    var image6=new Image()
    image6.src="poster066.jpg"
    </script>

    <script language="javascript">
    function openit() {
    newWindow = window.open('http://www.blaa-blaa.com/gallery/dimitri.php', 'myWindow', 'width=628,height=628');
    }
    </script>

    </head>
    <body background="bgr.gif" onload="openit();">

    <table width="801" border="0" align="center" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
    <td height="151" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
    <td width="745" height="151" align="left" valign="top"><img src="BlaaBlaa.gif" width="800" height="167"></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td width="364" height="329" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
    <td width="365" align="left" valign="top"> <blockquote>
    <p><strong>Site News & Info</strong><br>
    Blaa-Blaa.com once its ready will host mp3 streams &
    downloads from Waterford based DJ's and Bands as well as guest
    mixes. We will have a massive archieve of music varring from
    house to techno, hip hop to soul and everything in between. More
    information to follow. Make sure you come back now!<br>
    <br>
    We have added an <a href="javascript:openit();">image gallery</a> featuring
    pics from last saturday nights excellent Dimitri from Paris DJ
    set @ the Forum. If you have any photos from that night you want
    to share be sure to let us know so we can make a show of your mates! More
    to come! <br>


Comments

  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    I would change
    <a href="javascript:openit();" />

    to
    <a href="#" onClick="openit()" />


  • Registered Users Posts: 3,514 ✭✭✭Rollo Tamasi


    thanks seamus, i tried your code, but i'm getting the same results


  • Moderators, Politics Moderators Posts: 39,933 Mod ✭✭✭✭Seth Brundle


    you haven't closed the comment tag in the first script block.
    works fine for me then.


  • Moderators, Politics Moderators Posts: 39,933 Mod ✭✭✭✭Seth Brundle


    I was going to say that there was something wrong with the link <a href="javascript:Openit();"> when I copied it to my editor.
    But then i looked back here and saw why - you should use the code tags when inserting code.


  • Registered Users Posts: 3,514 ✭✭✭Rollo Tamasi


    kbannon wrote:
    you haven't closed the comment tag in the first script block.
    works fine for me then.

    Thanks Kbannon, nice one. Appriciate the help. Its always the most mundane thing that gets you! ;)


  • Advertisement
  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    D'oh!

    This is where code highlighting comes in handy :)


Advertisement