www.webdeveloper.com
Results 1 to 2 of 2

Thread: Compare Script & doctype

  1. #1
    Join Date
    Feb 2004
    Posts
    8

    Compare Script & doctype

    I am using a compare script on my site, but when I declare a doctype, the script no longer works in FF. Any help would be appreciated!
    Thanks!

    my doctype is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    and my script is:
    <script Language="JavaScript">
    <!--
    function compare(pid)
    {

    //first we make sure product is checked where link was clicked
    cb = document.getElementById("check_" + pid);
    cb.checked = true;

    // If a checkbox has been selected it will return true
    //msg = "products checked are: ";
    qs = "http://www.kitchensource.com/attributes/compare.cgi?p=";
    //qs = "{= $no_sort_link =}"

    for (i = 1; i < {= $total_products + 1 =} ; i++) {

    if (eval("form" + i + ".compare" + i + ".checked"))
    {
    //msg += form1.compare1.value;
    //msg += " ; " + eval("form" + i + ".compare" + i + ".value");
    qs += ":" + eval("form" + i + ".compare" + i + ".value");

    }
    }

    //alert( qs );
    //window.location.href = qs;

    anchor = document.getElementById("a_" + pid);

    //document.anchors[0].href = null;
    //document.anchors[0].href = qs;
    anchor.href= qs;

    //hs.htmlExpand(document.anchors[0], { objectType: 'ajax', preserveContent: false, dimmingOpacity: 0.10, align: 'center'} );
    hs.htmlExpand(anchor, { objectType: 'ajax', preserveContent: false, dimmingOpacity: 0.10, align: 'center'} );
    return 1;

    }

    -->
    </SCRIPT>

  2. #2
    Join Date
    Feb 2004
    Posts
    8
    sorry...forgot this part:


    <!-- START COMPARE -->
    <input id="check_{= $a->{ product_id } =}" type="checkbox" name="compare{= $total =}" value="{= $a->{product_id} =}">
    <a id="a_{= $a->{ product_id } =}" href=""></a>
    <a onclick="javascript:compare('{= $a->{ product_id } =}'); return false" href="#"><font size="1" face="Arial" color="000099">Compare</font></a>

    {# if ($a->{whats_new} ) #}
    &nbsp;&nbsp;&nbsp;<font id="whats_new">New!</font>
    {# endif #}
    <br>
    <br>


    <!-- END COMPARE -->

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles