Identical Javascript doesnt work in both IE and Chrome
Isnt it following two script is identical? but they seems to contradict in different browser.
--works in IE9 but not chrome
<script type="text/javascript">
var el=document.getElementById('myLink');
window.onload = function(){
measurePlt();
//$("#myLink").trigger('click');
el.trigger('click');
};
el.click(function(e) {
e.preventDefault();
});
</script>
--works in chrome but not in IE
<script type="text/javascript">
window.onload = function(){
measurePlt();
$("#myLink").trigger('click');
};
$("#myL开发者_如何学JAVAink")..click(function(e) {
e.preventDefault();
});
</script>
can someone pls help?
$("#myLink")..click(function(e) {
e.preventDefault();
});
Change the above piece of code from PART II to
$("#myLink").click(function(e) {
e.preventDefault();
});
精彩评论