开发者

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();
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜