Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Javascript Pop Up  (Read 2942 times)

0 Members and 1 Guest are viewing this topic.

rockstar4cs

    Topic Starter


    Intermediate

    Javascript Pop Up
    « on: October 08, 2009, 09:40:12 PM »
    I'm learning from a book how to make pop ups on a web site when a page loads. I'm copying the code correctly I think but I'm getting 2 errors. I went around to different sites looking for a code I couldn't copy and past to see what I was doing wrong and I get the same errors from every code. My pop up blocker is turned off. Right now my goal is to just make a blank pop up window. The errors I'm getting are

    Unterminated string constant Line 8
    window.html

    and

    Object expected line 15

    Code: [Select]
    <html>
    <head>
    <script language="javascript">
    <!-- begin

    function popup(Site)
    {
    window.open(Site,'PopupName','toolbar=no,statusbar=no,
    location=no,scrollbars=yes,resizable=yes,width=275,height=200')
    }

    // end -->
    </script>
    </head>
    <BODY onLoad="popup('time.html')">
    </body>
    </html>

    rockerest



      Hopeful
      • Yes
    • Experience: Experienced
    • OS: Windows 7
    Re: Javascript Pop Up
    « Reply #1 on: October 12, 2009, 03:50:33 PM »
    remove the line break between "statusbar=no," and "location=no"

    -rock
    In general, the PEBKAC.  Whether it's now or was three weeks ago, the PEBKAC.
    Unsafe browsing and general computer / internet illiteracy IS the users problem.  Don't have sex if you don't know how to use a condom.
    Also, there are 10 types of people in the world, those who understand binary, and those who don't.

    rockerest



      Hopeful
      • Yes
    • Experience: Experienced
    • OS: Windows 7
    Re: Javascript Pop Up
    « Reply #2 on: October 16, 2009, 12:34:23 PM »
    Errr.....sorry.  That might be one problem but you also need to terminate the line with a semi colon ( ; )

    -rock
    In general, the PEBKAC.  Whether it's now or was three weeks ago, the PEBKAC.
    Unsafe browsing and general computer / internet illiteracy IS the users problem.  Don't have sex if you don't know how to use a condom.
    Also, there are 10 types of people in the world, those who understand binary, and those who don't.