5
我有HTML代码块这样如何防止并发的JavaScript执行?
<div id="some-div">
<a href="#" class="link-click">some link text</a>
<div id="small-text">here is the small text</div>
//another text block
</div>
<script type="text/javascript">
$('#some-div').click(function(){//some task goes here});
$('.link-click').click(function(){//some task goes here for link});
$('#small-text').click(function(){//some task goes here for small div});
</script>
当我们点击股利(ID =一些-DIV)弹出消息来,但是当我点击链接(CLASS =链接点击)我需要运行另一个JavaScript函数。但事情是当我点击链接点击它也运行一些功能。意味着点击两个函数都可以运行。
我该如何防止并发的javascript函数执行。我也使用jquery。 谢谢
woo hoo不可思议的感谢kgiannakakis :) – Gayan