Jquery文件准备好两次射击 [英] Jquery document ready firing twice

查看:52
本文介绍了Jquery文件准备好两次射击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用jquery在页面中动态加载了一个用户控件。

在用户控件中我使用document.ready事件进行某些操作,但是这个就绪事件在用户控件是加载到主页面。

任何人都可以帮我解决这个问题吗?



先谢谢你...

解决方案

在代码中发现问题。

我正在调用

(#someID)的加载方法成功回调加载方法我使用

加载了usercontrol HTML输出到


(someID)

I have loaded a user control in a page dynamically using jquery.
In user control I am using document.ready event to some operation,but this ready event is firing twice when the user control is loaded into the main page.
Can anybody help me with this problem?

Thanks in Advance...

解决方案

Found the problem in code.
I was calling the load method of


("#someID") and in success callback of load method I loaded the usercontrol HTML output to


("someID") using


这篇关于Jquery文件准备好两次射击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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