Results 1 to 5 of 5

Thread: Having trouble with java window open code

  1. #1
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Having trouble with java window open code

    The following code was designed to enlarge my thumbnail images and does so, but at intermediate times will stop working. Any suggestions would be greatly appreciated.





    <TITLE>Java Popup Window</TITLE>
    <SCRIPT language="JavaScript" type="text/javascript">
    <!-- ;
    var newwindow = ''
    function popitup(url) {
    if (newwindow.location && !newwindow.closed) {
    newwindow.location.href = url;
    newwindow.focus(); }
    else {
    newwindow=window.open(url,'htmlname','width=200,height=175,resizable=0');}
    }

    function tidy() {
    if (newwindow.location && !newwindow.closed) {
    newwindow.close(); }
    }
    Last edited by Otto; 01-24-2008 at 08:14 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Don't use:

    Code:
    language="JavaScript"
    The language attribute has been deprecated. But that probably isn't the problem. However, other than that, the code looks OK. I can't see the rest of the page and its code though. Scripts don't necessarily happen in a vacuum.

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for your response. The rest of the code is in PHP, so I am pulling PHP variables from a database to pass to this function.

  4. #4
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    FOLLOWING IS COMPLETE CODE:
    IF YOU WANT TO SEE IT IN ACTION GOTO: WWW.TEXASCARANDTRUCKACCESSORIES.COM

    CLICK ON TRIM THEN SELECT TAHOE.

    THANKS FOR HELP.



    <HTML>
    <HEAD>
    <TITLE>Java Popup Window</TITLE>
    <SCRIPT type="text/javascript">
    <!-- ;
    var newwindow = ''


    function popitup(url) {
    if (newwindow.location && !newwindow.open) {
    newwindow.location.href = url;
    newwindow.focus(); }
    else {
    newwindow=window.open(url,'htmlname','width=300,height=225,resizable=0');}
    }

    function tidy() {
    if (newwindow.location && !newwindow.closed) {
    newwindow.close(); }
    }

    </SCRIPT>
    </HEAD>

    <BODY onUnload="tidy()" >







    <?

    $pageName = "parts";
    $pageTitle = "PARTS AT WHOLESALE PRICING";

    include("includes/formatting.php");

    dbConnect();



    buildHeader(); ?>



    <div align="center">


    <table width="840" cellspacing="0" cellpadding="0" border="0" style="margin-left:10px">

    <tr valign="top">

    <td align="left"><strong>NEED PARTS?</strong><br/>Please make a selection from the list below.</td>

    </tr>

    <tr valign="top">

    <td><br/></td>

    </tr>

    <?

    print(" <tr valign=\"top\">\n");

    print(" <td align=\"left\">\n");

    print(" <table width=\"600\" cellpadding=\"5\" cellspacing=\"1\" border=\"0\">\n");

    print(" <tr valign=\"middle\">\n");

    print(" <td bgcolor=\"#ebebeb\"><br/></td>\n");

    print(" <td bgcolor=\"#ebebeb\"><strong>Image</strong></td>\n");

    print(" <td bgcolor=\"#ebebeb\"><strong>Size</strong></td>\n");

    print(" <td bgcolor=\"#ebebeb\" width=\"300\"><strong>Description</strong></td>\n");

    print(" <td bgcolor=\"#ebebeb\" nowrap=\"nowrap\"><strong>Price</strong></td>\n");

    print(" </tr>\n");












    $partsTahoeQuery = "SELECT * FROM partsTahoe ";
    $partsTahoeQuery .="ORDER BY TahoeID ASC";



    $mysql_result = mysql_query($partsTahoeQuery);



    while($row = mysql_fetch_row($mysql_result)) {
    $TahoeID = $row[0];
    $TahoeName = $row[1];
    $TahoeDesc = $row[2];
    $TahoeImage = $row[3];
    $TahoePrice = $row[4];

    print(" <input type=\"hidden\" name=\"TahoeID\" value=\"$TahoeID\">\n");
    print(" <tr valign=\"middle\">\n");
    print(" <td bgcolor=\"#ebebeb\"><input type=\"checkbox\" name=\"partsTahoe" . $TahoeID . "\" /></td>\n");
    print(" <td bgcolor=\"#ebebeb\">");

    if ($TahoeImage != "") {
    print(" <a href=\"javascriptopitup('products/parts/" . $TahoeImage . "')\"><img src=\"products/parts/" . $TahoeImage . "\" border=\"0\" width=\"75\" /></a>\n");
    } else {
    print("<img src=\"products/no_image_75px.gif\" border=\"0\" width=\"175\" />");
    }

    print("</td>\n");
    print(" <td bgcolor=\"#ebebeb\"><strong>" . $TahoeName . "</strong></td>\n");
    print(" <td bgcolor=\"#ebebeb\" width=\"300\">" . $TahoeDesc . "</td>\n");
    print(" <td bgcolor=\"#ebebeb\" nowrap=\"nowrap\"><input type=\"text\" name=\"partQty\" value=\"1\" size=\"1\" /> @ $" . number_format($TahoePrice,2) . "/each</td>\n");
    print(" </tr>\n");

    $rowCount++;

    }


    print(" <td bgcolor=\"#ffffff\" colspan=\"5\" align=\"center\"><a href=\"cart_cart.php\" target=\"_main\"><img src=\"images/btn_add_cart.gif\" alt=\"\" width=\"219\" height=\"20\" border=\"0\" style=\"margin-top:15px;\" /></a></td>\n");
    print(" </tr>\n");
    print(" <tr>\n");
    print(" <td bgcolor=\"#ffffff\" colspan=\"5\" align=\"center\"><strong>or</strong></td>\n");
    print(" </tr>\n");
    print(" <tr>\n");
    print(" <td bgcolor=\"#ffffff\" colspan=\"5\" align=\"center\"><a href=\"home.php\"><img src=\"images/btn_continue_shopping.gif\" alt=\"\" width=\"219\" height=\"20\" border=\"0\" /></a></td>\n");
    print(" </tr>\n");
    print(" </table>\n");
    print(" </td>\n");
    print(" </tr>\n");
    print(" <tr><td><img src=\"images/spacer.gif\" width=\"2\" height=\"30\"; border=\"0\"></td></tr>\n");
    ?>

    </table></td>

    </tr>

    </table>
    </form>

    </div>

    <br />

    <? buildFooter(); ?>

  5. #5
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    www.texascarandtruckaccessories.com

    You need to click the TRIM link then select tahoe.

Bookmarks

Posting Permissions

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