将函数包在红色字体内部,可以解决$符号与其他插件的冲突。

<script type="text/javascript">

(function($, window, document) {
//$(document).ready(function(){
var param_cats = $("input[name='category[]']:checked").val();
if(param_cats == null || param_cats == '') {
param_cats = '0';
}
else {
$('#ehp-topblogs-title').html('Top Blogs in ' + $("input[name='category[]']:checked").next().html() + ':');
// $('#ehp-topblogs-title').html('Top Blogs in All Categories:');
}
var post_data_top_loved = {
action: 'top_loved',
item_cats: param_cats,
top_loved_nonce: top_loved_vars.nonce
};
$.post(top_loved_vars.ajaxurl, post_data_top_loved, function(response) {
$('#divBlogsGroup').html(response);
$('#span-blog-loading').delay(1500).hide();
});
// });
})(jQuery, window, document);

</script>

(function($, window, document) {}) jQuery 调用解决与其他javascript库冲突的写法的更多相关文章

  1. jQuery避免$符和其他JS库冲突的方法对比

    1.如果jquery库在第三方库之后引用.这个时候jquery库会占用$. 解决办法:剔除$符号的使用权. <script type="text/javascript" sr ...

  2. jQuery noConflict() 方法----与其他javaScript插件冲突时

    1,全名代替----jQuery: $.noConflict(); jQuery(document).ready(function(){ jQuery("button").clic ...

  3. 【原】IOS合并lib(.a)库的终极可用方法(可用于解决duplicate symbol静态库冲突)

    网上流传了太多关于合并lib库的方法,自己也尝试过,但大多失败.有感于这种急于解决问题,经过百般尝试后依旧无果的无奈心情,小翁在这里用一个实例来完整阐述如何在mac中合并lib静态库. 这里以移动广告 ...

  4. JS (function (window, document, undefined) {})(window, document)的真正含义

    原文地址:What (function (window, document, undefined) {})(window, document); really means 按原文翻译 在这篇文章中,我 ...

  5. 详解jquery插件中;(function ( $, window, document, undefined )的作用

    在jquery插件中我们经常看到以下这段代码 1 2 3 ;(function ( $, window, document, undefined ){ //函数体内具体代码 })(jQuery, wi ...

  6. 详解;(function ($,window,document,undefined){...})(jQuery,window,document);

    1.代码最前面的分号,可以防止多个文件压缩合并以为其他文件最后一行语句没加分号,而引起合并后语法错误. 2.匿名函数(function(){})();:由于Javascript执行表达式是从圆括号里面 ...

  7. jquery插件中(function ( $, window, document, undefined )的作用

    在jquery插件中我们经常看到以下这段代码 ;(function ( $, window, document, undefined ){ //函数体内具体代码 })(jQuery, window,d ...

  8. 详解jquery插件中(function ( $, window, document, undefined )的作用。

    1.(function(window,undefined){})(window); Q:(function(window,undefined){})(window);中为什么要将window和unde ...

  9. ;(function($,window,document,undefined){})(jQuery,window,document)

    ;(function($,window,document,undefined){})(jQuery,window,doucment) 1.自调函数(function(){})() 2.好处是不会产生任 ...

随机推荐

  1. UVALive 5000 Underwater Snipers --二分

    题意:一条河岸线y=k,y>k区域有n个敌人,现在要在y<=k区域布置S个狙击手,狙击手的狙击范围为距离自己半径为D的圆内,问满足能够狙死所有的敌人的情况下,离河岸线最近的那个狙击手的离河 ...

  2. Guava中Predicate的常见用法

    Guava中Predicate的常见用法 1.  Predicate基本用法 guava提供了许多利用Functions和Predicates来操作Collections的工具,一般在 Iterabl ...

  3. 解决为什么每次打开Eclipse新的workspace需要更新nexus-maven-repository-index问题

    解决为什么每次打开Eclipse新的workspace需要更新nexus-maven-repository-index问题 新建一个Eclipse的workspace. 打开Window—>Pr ...

  4. Android中实现如下多语言选择Radiobutton效果

    手边的samsung手机设置多语言的方式一般是点击设置多语言的一栏后进入到多语言选择界面,选择完成之后当前的语言环境用小字方式直接显示在设置多语言栏的下方.另一种选择多语言的方式如上图所示,我也在系统 ...

  5. CSS3边框图片属性---border-image

    #div{ border:18px solid; border-image:url("http://img.mukewang.com/52e22a1c0001406e03040221.jpg ...

  6. Java 8特性探究(1):通往lambda之路与 lambda表达式10个示例

    本文由 ImportNew 函数式接口 函数式接口(functional interface 也叫功能性接口,其实是同一个东西).简单来说,函数式接口是只包含一个方法的接口.比如Java标准库中的ja ...

  7. 编译php-5.6出错,xml2-config not found

    今天在centos上编译PHP-5.6 cd php-5.6 ./configure --prefix=/usr/local/php5./ --with-apxs2=/usr/local/apache ...

  8. zlog学习笔记(zc_arraylist)

    zc_arraylist.h /** * 实现类似列表的功能 * */ #ifndef __zc_arraylist_h #define __zc_arraylist_h #define ARRAY_ ...

  9. Jquery 数组操作

    1.数组的创建 var arrayObj = new Array(); //创建一个数组 var arrayObj = new Array([size]); //创建一个数组并指定长度,注意不是上限, ...

  10. 前端见微知著JavaScript基础篇:你所不知道的apply, call 和 bind

    在我的职业生涯中,很早就已经开始使用JavaScript进行项目开发了.但是一直都是把重心放在了后端开发方面,前端方面鲜有涉及.所以造成的一个现象就是:目前的前端知识水平,应付一般的项目已然是足够的, ...