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:
- 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.
- Try other events. Instead of live, try straight-click to see if that matters.
- Make sure your function is being called on document-load. I suspect it isn't.
精彩评论