SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery and data-attr

    This concerns a table where I show 5 rows at a time.
    The follow code is working 100 percent perfect in firefox. But in ie8,
    only the top row can be clicked for the editdiv to show. Whereas, in firefox
    I can click on any of the five rows and the editdiv loads as expected.

    Line in php file that calls the function:
    Code:
    echo "<td><a id=\"editjq\" href=\"#\" vid='".$vid."' t1='".$db->hscadd($t1)."' page='".$page."' flag='1')\">  [edit ]  </a></td>";
    The function:
    Code:
    $(document).ready(function() {
    $('a#editjq').click(function() {
    var petid = $(this).attr('vid');
    var t1 = $(this).attr('t1');
    var page = $(this).attr('page');
    var flag = $(this).attr('flag');
    $("#petdiv").hide(); 
      $.post("edit_lookup.php", {
        petid : petid,
        t1 : t1,
        page : page
        }, function(data){
       if (data.length>0){ 
         $("#editdiv").html(data); 
       } 
      });
     $(this).unbind(); 
    return false;
     });
    });  //end/////////////////
    Does anyone know why this doesn't work in ie8?

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,189
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Try using a class instead of an id

  3. #3
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Class worked, thanks


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
  •