开发者

div onclick not firing in IE 8 and Chrome

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜