click()事件在jquery中调用了两次 [英] click() event is calling twice in jquery

查看:190
本文介绍了click()事件在jquery中调用了两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了一个链接元素,并在jquery中调用了它的click事件,但是click事件被调用了两次,请参见下面的jquery代码.

I setup a link element and called its click event in jquery but the click event is calling twice, please see below the code of jquery.

$("#link_button")
.button()
.click(function () {
   $("#attachmentForm").slideToggle("fast");
});

请告知.

谢谢.

推荐答案

请确保并检查是否没有在HTML页面中两次意外包含脚本.

Make sure and check that you have not accidentally included your script twice in your HTML page.

这篇关于click()事件在jquery中调用了两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆