Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts

    javascript:newWin() not working for some reason

    haha, i "posted" this 5 mins ago, but forgot i hit preview and closed the window... gj me.

    okay, essentially i'm getting an "object expected" error whenever i click on any of the links on this page. i'm trying to use a popup script for each link

    heres the code

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Stingray Info</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    
            <script type=text/javascript> 
    function newWinPDF(urlLoc) {
      _winName = "MyNewWindow";
      _info  = "toolbar=no";     // yes|no 
      _info += ",location=no";   // yes|no 
      _info += ",directories=no";// yes|no 
      _info += ",status=no";    // yes|no 
      _info += ",menubar=no";    // yes|no 
      _info += ",scrollbars=yes";// yes|no 
      _info += ",resizable=yes"; // yes|no 
      _info += ",dependent";     // close the parent, close the popup, omit if you want otherwise 
      DispWin=window.open(urlLoc,_winName,_info);
    } 
          </script>
    
    
    <script type=text/javascript> 
    function newWin(urlLoc) {
      _winName = "MyNewWindow";
      _info  = "toolbar=yes";     // yes|no 
      _info += ",location=no";   // yes|no 
      _info += ",directories=no";// yes|no 
      _info += ",status=no";    // yes|no 
      _info += ",menubar=yes";    // yes|no 
      _info += ",scrollbars=yes";// yes|no 
      _info += ",resizable=yes"; // yes|no 
      _info += ",dependent";     // close the parent, close the popup, omit if you want otherwise 
      DispWin=window.open(urlLoc,_winName,_info);
    } 
          </script>
    
    
    <ul>
      <br style="MARGIN-BOTTOM: 2px">
      <LI><FONT face=Verdana size=2><a href="javascript:newWin('specsstingray.htm');" style="color:blue;visited:blue;text-decoration:underline" target="_blank">Stingray Engineering Specifications</A></FONT>
      <LI><FONT face=Verdana size=2><a href="javascript:newWinPDF('StingrayBrochure.pdf');" style="color:blue;visited:blue;text-decoration:underline" target="_blank">Stingray Brochure</A> </FONT><FONT face=Verdana size=1>(834KB Adobe Acrobat file)</FONT>    
      <LI><FONT face=Verdana size=2><a href="javascript:newWinPDF('Stingray%20Manual%20Series%20A1.pdf');" style="color:blue;visited:blue;text-decoration:underline"target="_blank">Stingray User's Guide </A></FONT><FONT face=Verdana size=1> (1341KB Adobe Acrobat file)</FONT>    
      <LI><FONT face=Verdana size=2><a href="javascript:newWinPDF('VSJmountingbands.pdf');" title="Adjustable Stainless Steel Mounting Bands for Round Pipes" style="color:blue;visited:blue;text-decoration:underline" target="_blank">Optional Pipe Mounting Bands</A></FONT><FONT face=Verdana size=1> (300KB Adobe Acrobat file)</FONT>    
      <LI><FONT face=Verdana size=2><a href="javascript:newWin('howitwk_av.htm');" style="color:blue;visited:blue;text-decoration:underline" target="_blank">How It Works</A></FONT>    
    </ul>
    <p>&nbsp;</p>
    </body>
    </html>
    Here's an unedited version of the popup script

    Code:
            <script type=text/javascript> 
    function newWin(urlLoc) {
      _winName = "MyNewWindow";
      _info  = "toolbar=no";     // yes|no 
      _info += ",location=no";   // yes|no 
      _info += ",directories=no";// yes|no 
      _info += ",status=no";    // yes|no 
      _info += ",menubar=no";    // yes|no 
      _info += ",scrollbars=no";// yes|no 
      _info += ",resizable=yes"; // yes|no 
      _info += ",dependent";     // close the parent, close the popup, omit if you want otherwise 
      _info += ",height=250";
      _info += ",width=425";
      _info += ",left=465";
      _info += ",top=100";
      DispWin=window.open(urlLoc,_winName,_info);
    } 
          </script>
    any ideas?

    oh, ps, the page i gave above is being loaded into a popup using the same script... that may help
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Get rid of the target stuff on each link:
    Code:
    <LI><FONT face=Verdana size=2><a href="javascript:newWin('howitwk_av.htm');" style="color:blue;visited:blue;text-decoration:underline" target="_blank">How It Works</A></FONT>
    You don't need it as you're already opening a new page.. I'm not sure why it would cause a problem, but I'm pretty sure that's what it is.

    Let me know how it works out for you.

    Sadiq.

  • #3
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    you are SO on!

    always comming through for me.

    Thanks,
    -- Jay
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •