开发者

div onclick not firing in IE 8 and Chrome

开发者 https://www.devze.com 2023-04-13 08:42 出处:网络
I have the following javascript function in my application which is expected to perform grid filtering based on the div click, but the major problem i am facing is that the div click is working fine i

I have the following javascript function in my application which is expected to perform grid filtering based on the div click, but the major problem i am facing is that the div click is working fine in mozilla firefox , but not in IE 8 and chrome, can anyone help to figure the issue related to this function

$(function(){
    $('#FileDiv').live('click', function (e) {开发者_高级运维
       alert(1);

    });
});


Need the HTML to verify, but here's where I've run into trouble with this:

  1. Make sure a div with id="FileDiv" is actually there. I see you're using ASP.NET and I have spent time debugging client-side code affecting content that was not delivered becuase of server-side logic. Real forehead-smacking stuff.
  2. Try other events. Instead of live, try straight-click to see if that matters.
  3. Make sure your function is being called on document-load. I suspect it isn't.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号