Jquery Click Event Not Firing On First Click, but does on second click, why?

佐手、 提交于 2019-12-04 06:51:48

This is a longshot, but are you running some sort of tracking script? Like webtrends or coremetrics (or even some of your own script, that's globally looking for all clicks)? I ran into a similar problem a while ago, where the initial-click was being captured by coremetrics. Just a thought.

Does it still happen if you comment out all your code and simply have an alert("hi") inside the click function?

Update

I think Sarfaz has the right idea, but I would use the document ready function like so

$(document).ready(function(){
  $("a.reply").click(function() {
    //code
  });
});

I just ran into same problem and I resolved my problem by removing:

<script src="bootstrap.js"></script>

you can use bootstrap.min.js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!