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

<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. HashMap的工作原理深入再深入

    前言 首先再次强调hashcode (==)和equals的真正含义(我记得以前有人会说,equals是判断对象内容,hashcode是判断是否相等之类): equals:是否同一个对象实例.注意,是 ...

  2. 网页中导入特殊字体@font-face属性详解

    @font-face是CSS3中的一个模块,他主要是把自己定义的Web字体嵌入到你的网页中. 语法规则 首先我们一起来看看@font-face的语法规则: @font-face { font-fami ...

  3. 计算2的N次方&&计算e

    2的N次方 注意:这里在处理的时候并没有用循环来处理,而是用移位的做法.    n<<4  就是 n*2^4    ,所以在本例中只需要写 1<<time  (time是要求的 ...

  4. 2016.11.17 NOI plus day0

    今天很乱乱乱乱 根本不想写代码 玩了一早上了 昨晚失眠了 今天又懵逼了 中午就要走了 明天就要考试了 考完试回来就要补文化课了 现在我的内心很平静 因为已经紧张的冻结了 你知道什么叫彷徨么? 机房里的 ...

  5. webstorm的中文教程和技巧分享

    webstorm是一款前端javascript开发编辑的神器,此文介绍webstorm的中文教程和技巧分享.webstorm8.0.3中文汉化版下载:百度网盘下载:http://pan.baidu.c ...

  6. jquery工具方法makeArray/merge

    makeArray : 类数组转真数组 merge : 合并数组或转特殊json 使用例子(外部使用): var aDiv = document.getElementsByTagName('div') ...

  7. Python自动补全

    转自:http://blog.linuxeye.com/324.html Python自动补全有vim编辑下和python交互模式下,下面分别介绍如何在这2种情况下实现Tab键自动补全. 一.vim ...

  8. TP框架实现分页

    TP框架自带分页的实现方法,所以使用这个分页方案,不用再重新造轮子 1,先看效果图 2,源码 /** * TODO 基础分页的相同代码封装,使前台的代码更少 * @param $m 模型,引用传递 * ...

  9. MySQL数据库的优化(上)单机MySQL数据库的优化

    MySQL数据库的优化(上)单机MySQL数据库的优化 2011-03-08 08:49 抚琴煮酒 51CTO 字号:T | T 公司网站访问量越来越大,导致MySQL的压力越来越大,让我们自然想到的 ...

  10. LeetCode 2. Add Two Numbers swift

    // // main.swift // leetcode02 // // Created by GuoLa on 16/1/21. // Copyright © 2016年 GuoLa. All ri ...