jQuery库的多重引用 [英] Multiple reference of jquery libs

查看:46
本文介绍了jQuery库的多重引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
在我的aspx页面中,我正在使用usercontrol作为菜单.在用户控制中,我引用了jquery.js.

在aspx我有Fullcalendar插件的"jquery-1.8.1.min.js"引用.由于日历中jquery插件的多个引用不起作用(抛出javascript错误).

我如何才能对jquery进行多个引用,才能正常工作,请帮忙.

在此先感谢

Hi All,
In my aspx page i`m using usercontrol for menu. in user control i am having reference to jquery.js.

in aspx i`m having "jquery-1.8.1.min.js" reference for fullcalendar plugin.Due to multiple references of jquery plug in calendar is not working(throws javascript error).

how can i have multiple references to jquery working correctly , please help.

Thanks in advance

推荐答案

为什么需要多个参考?只需参考您的基本/母版页即可.您不需要在每个用户控件上都引用该文件.
Why do you need to have multiple reference? Just refer your base/master page and that should do. You don''t need to refer the file on every usercontrol.


不要对同一JS文件有多个引用,因为这会减慢您的应用程序的运行速度.
只需一次在您的母版页中引用这些文件:

Do not have multiple References of same JS Files as it will slow down your application.
Just Refer to these Files in Your Master page once:

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/pepper-grinder/jquery-ui.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.min.js"></script>


这篇关于jQuery库的多重引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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