多个js引用同一个jquery 避免冲突
2014-12-05 13:45
141 查看
<script type="text/javascript">
var $j = jQuery.noConflict(); //自定义一个比较短快捷方式 防止jquery 命名冲突
// $j(document).ready(function () {
$j.ajax({
type: "POST",
url: "WebService.asmx/GetPubThumbSlider",
dataType: "json",
data: "{SL:'10'}",
contentType: "application/json; charset=utf-8",
async: true,
success: function (response) {
$j("#pubThumb").html(response.d);
},
error: function (request, status, error) {
alert("寄语提取数据错误!");
}
});
// });
</script>
var $j = jQuery.noConflict(); //自定义一个比较短快捷方式 防止jquery 命名冲突
// $j(document).ready(function () {
$j.ajax({
type: "POST",
url: "WebService.asmx/GetPubThumbSlider",
dataType: "json",
data: "{SL:'10'}",
contentType: "application/json; charset=utf-8",
async: true,
success: function (response) {
$j("#pubThumb").html(response.d);
},
error: function (request, status, error) {
alert("寄语提取数据错误!");
}
});
// });
</script>
相关文章推荐
- jQuery避免$符和其他JS库冲突的方法对比
- js replace 全局替换 以表单的方式提交参数 判断是否为ie浏览器 将jquery.qqFace.js表情转换成微信的字符码 手机端省市区联动 新字体引用本地运行可以获得,放到服务器上报404 C#提取html中的汉字 MVC几种找不到资源的解决方式 使用Windows服务定时去执行一个方法的三种方式
- jQuery避免$符和其他JS库冲突的方法对比
- jQuery如何操作用Vue.js template的元素,用vm.$refs.id--id是vue的ref指定的一个引用
- 同一个页面中引用两个同样的Jquery树
- jQuery与其他JS库冲突解决
- jQuery库与其他JS库冲突的解决办法
- Jquery操作Select 简单方便 一个js插件搞定
- 一个jQuery热键插件:js-hotkeys
- 在一个js文件里远程调用jquery.js会在ie8下的一个奇怪问题
- jQuery和JS文件冲突的解决方法
- jQuery validate插件与prototype.js冲突的解决办法
- 一个需要手动释放引用,避免内存溢出的例子
- 赏"金"猎人-Prototype.js与jQuery.js冲突,noConflict未果
- js与jquery给一个ID加CSS样式
- jQuery库与其他JS库冲突的解决办法
- Jquery操作Select 简单方便 一个js插件搞定
- JQuery 和 json.js 冲突问题
- JQuery选取器与其它JS框架冲突的解决方法 确保jQuery不会与其他库的$对象发生冲突
- ASP.NET一个页面多个Button按钮事件避免数据验证控件RequiredFieldValidator冲突方法