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 7560483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:54:51+00:00 2026-05-30T12:54:51+00:00

Got some solved troubles, but want to ask, maybe here is another solution. Here

  • 0

Got some solved troubles, but want to ask, maybe here is another solution. Here is a situation.
Got aspx page. With some code behind functions, that get data from DB. Functions called and data returned through JQ in table. Data prepared by server to math html format.

$.ajax({
            type: "POST",
            url: "somePage.aspx/foo",
            data: "{ 'Id' : '" + ID + "'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(msg) {
                $("#brandTable").html(msg.d);
            }

Each returned row is looking like this (as is):

<tr btcsId='152' id='btcsId_152' onclick='brandClick(9,24,152)'>
<td class='DataGridItem' style='padding:3px; margin:0;font-weight:bolder;'>something<input type='hidden' id='brandID_btcsId152' value='24' brandName='something'/></td>
</tr>

table markup:

<table class="DataGrid" id="brandTable" style="padding: 0px; margin: 0px; width:100%;border-collapse:collapse;table-layout:fixed;word-wrap:break-word;" border = "0" cellspacing="0" cellpadding="0">
    </table>

So, the problem was, that event onclick not fired just in ie7. ie8,ie9 works fine. After some thoughts, i decided to add this code immediately afrter table filling. In other words reinit event for each row.

$("[id^='btcsId_']").each(function () {
    $(this).click(function () {
    var thisID = $(this).attr("id");
    brandClick(specialityID,$("#"+thisID +" > TD > INPUT").val(),$(this).attr("btcsId"));
    });
});

After that it seems work fine. But is it correct? Maybe there is some other way?

  • 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-30T12:54:53+00:00Added an answer on May 30, 2026 at 12:54 pm

    The bast way would bo using delegate() or on() (jQuery > 1.7) to delegate to your table Element the handling of those events: this works also for elements that are added dinamically

    $("table#idofYourTable").on("click", "[id^='btcsId_']", function () {
        var thisID = this.id;
        brandClick(specialityID,$("#"+thisID +" > TD > INPUT").val(),$(this).attr("btcsId"));
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
Solved this ages ago, but this question recently got some attention so I'm adding
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
I got some legacy code with that caption spread out as comment almost in
I got some legacy code that has this: <?PHP if(isset($_GET['pagina'])==homepage) { ?> HtmlCode1 <?php
After some problems solved, I got a tricky stuff. I am using an overlay
Basically I got the problem solved, but I am trying to find a more
(There is a very similar topic that never got solved: here ) We have
Ive got some data (not that the data actually exists until after I solved
I've got some 2D geometry. I want to take some bounding rect around my

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.