Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 970383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:47:49+00:00 2026-05-16T02:47:49+00:00

I am unfortunately having some more problems with JQuery of late. I am working

  • 0

I am unfortunately having some more problems with JQuery of late. I am working on a project in which I need to have an AJAX application working in all major browsers, including IE6 and IE7. I have created a click event for a button of the class “update” and “delete” in which an ajax request will be sent to the server. Unfortunately in IE6 (and only IE6) the event will not fire. After much experimentation I realized that it was the class selector. Here are some code tests I have been doing to get a click event to fire:

$(".update").bind('click', function (event) {

alert("update fired");

});

 $('#BotTable').delegate('.update', 'click', function(event){

alert("update fired");
});

$('#BotTable').click(function (event) {

if ($(event.target).is('.update')) {

    alert("update fired");
        }

   });

Does anyone know why none of these work? Thank you very much for your help

Edit: here is the full code:

       $(document).ready(function() {

    $.ajaxSetup({ cache: false });


    var items = "";                         

    var information = $.ajax({ type: "GET", dataType: "html", url: "ShoppingCart2.aspx", data: "Total=t&Name=n&Price=p&Quantity=q&ProductCode=p", async: false }).responseText + " ";

    items = information.substring(3, information.indexOf("#"));

    information = information.substring(information.indexOf("#") + 1);

    var id = 0;
    while(information.indexOf("~") > 0 & id > - 1)
      {

        var subString = information.substring(0, information.indexOf("~"));

        information = information.substring(information.indexOf("~") + 1); //~ is our delimiter.  This allows me to get the appropriate item.           
        var ProductTotal = subString.substring(subString.indexOf("*") + 1);
        var ProductName = subString.substring(subString.indexOf("|") + 1,    subString.indexOf("@"));           
        var ProductPrice = subString.substring(subString.indexOf("@") + 1, subString.indexOf("^"));
        var ProductQty = subString.substring(subString.indexOf("^") + 1, subString.indexOf("*"));
        var ProductCode =  subString.substring(0, subString.indexOf("|"));


        //add a row to the table


        var tblRow = document.getElementById('BotTable');//$('#BotTable');
        var lastRow = tblRow.rows.length;
        var row = tblRow.insertRow(lastRow);

        //now we add in cells


        var cellOne = row.insertCell(0);
        var textNode = document.createTextNode(ProductCode);
        cellOne.id = 'prodCode' + id;
        cellOne.appendChild(textNode);
        // cellOne.id = 'prodCode' + id;

        var cellTwo = row.insertCell(1);
        var textNode2 = document.createTextNode(ProductName);
        cellTwo.id = 'prodName' + id;
        cellTwo.appendChild(textNode2);


        var cellThree = row.insertCell(2);
        var textNode3 = document.createElement("input");
        textNode3.value = ProductQty;
        textNode3.id = 'quantity' + id;
        cellThree.id = 'quantityCell' + id;
        cellThree.appendChild(textNode3);       


        var cellFour = row.insertCell(3);
        var textNode4 = document.createTextNode(ProductPrice);
        cellFour.id = 'prodPrice' + id;
        cellFour.appendChild(textNode4);

        var cellFive = row.insertCell(4);
        var textNode5 = document.createTextNode(ProductTotal);
        cellFive.id = 'prodTotal' + id;
        cellFive.appendChild(textNode5);

        var update = "update" + id.toString();
        var cell6 = row.insertCell(5);
        var textNode6 = document.createElement('input');
        textNode6.setAttribute('type', 'button');
        textNode6.id = update;
        textNode6.setAttribute('class', 'update');
        cell6.id = 'updateCell' + id;
        cell6.appendChild(textNode6);

        var delete1 = "delete" + id.toString();
        var cellSeven = row.insertCell(6);
        var textNode7 = document.createElement('input');
        textNode7.setAttribute('type', 'button');
        textNode7.id = delete1;
        textNode7.setAttribute('class', 'delete');
        cellSeven.id = 'deleteCell' + id;
        cellSeven.appendChild(textNode7);

        id++;
          }

          $(".update").bind('click', function (event) {

        alert("hello!");

          });


        $('#BotTable').delegate('.update', 'click', function(event){

        alert("the first part pinged");
        // step 1: get the # inside this button. Then find the textbox with that number
        var idNum = event.target.id.substring(6); //this is the ID number.

        //step 2: get data from textbox. qAmount = QueryAmount
        var qAmount = $('#quantity' + idNum).val();


        var strCost = $.ajax({ type: "GET", dataType: "html", url: "ShoppingCart2.aspx", data: "Qty=" + qAmount +  "&itemNumber=" + idNum, async: false }).responseText + " ";
            txtTotal = $('#prodTotal' + idNum.toString());
            txtTotal.empty();

            txtTotal.append(strCost.substring(3, strCost.indexOf("|")));

            txtPrice = $('#prodPrice' + idNum.toString());
            txtPrice.empty();
            txtPrice.append(strCost.substring(strCost.indexOf("|") + 1), strCost.indexOf("<"));

        });



    $('#BotTable').delegate('.delete', 'click', function(event){

    alert("Update hit"); //never happens in IE
    //  $("#BotTable").delegate('.delete', 'click', function (event) {

        //find the current id via the button that was clicked on
        var idNum = event.target.id.substring(6);   

        //set amount for the query string as 0
        var qAmount = 0;

        //find the product code for this row
        var txtProdCode = $('#prodCode' + idNum.toString());
        //use a querystring to send 0 for selected productID thus removing it from the cart
        $.get("ShoppingCart2.aspx", {"itemNumber" : idNum, "Qty": qAmount});

        //find all the cells of the row to be deleted
        var prodName = $('#prodName' + idNum.toString());
        var quantity = $('#quantity' + idNum.toString());
        var prodPrice = $('#prodPrice' + idNum.toString());
        var prodTotal = $('#prodTotal' + idNum.toString());
        var update = $('#update' + idNum.toString());
        var delete1 = $('#delete' + idNum.toString());

        //remove the cells from the page
        txtProdCode.empty();
        prodName.empty();
        prodPrice.empty();
        prodTotal.empty();
        update.remove();
        delete1.remove();
        quantity.remove();
        });

        $(".update").bind('click', function (event) {
                      alert("update hit");
                      } 
                   });

             $('#BotTable').click(function (event) {
               if ($(event.target).is('.update')) {
                 alert("update fired");
               }
             });

    });

sorry it’s so long…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T02:47:50+00:00Added an answer on May 16, 2026 at 2:47 am

    Try setting your instances of setAttribute('class',...) to use className instead.

    If I recall, IE6 doesn’t accept ‘class’ in setAttribute().

    textNode6.setAttribute('className', 'update');
    
    textNode7.setAttribute('className', 'delete');
    

    or perhaps both will be required:

    textNode6.setAttribute('class', 'update');
    textNode6.setAttribute('className', 'update');
    
    textNode7.setAttribute('class', 'delete');
    textNode7.setAttribute('className', 'delete');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We unfortunately find ourselves having to support our product in IE 6 because some
I'm having trouble with some data I've imported from an XML file. Unfortunately I'm
Unfortunately, I have to deal with J2ME (which I consider ancient technology these days)
Unfortunately, I often find I need to reboot to wipe some unhealthy Xcode state.
I'm very interested in making real-time web apps with Django. Unfortunately, I'm having more
I have a situation where I need to write some unit tests for some
I'm having some positioning problems on my gallery page of my website. I haven't
I have a number of stored procs which I would like to all run
I have a Java background so I’m used to having Maven handle all problem
I have some layout css questions. Their more like best practices and whats the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.