<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>QLJ's Blog &#187; jquery</title>
	<atom:link href="http://qlj.sh.cn/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://qlj.sh.cn</link>
	<description>搜集网络信息,风云磅实验</description>
	<lastBuildDate>Thu, 26 Jan 2012 21:20:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>一个简单的短消息JQUERY+AJAX PUSH</title>
		<link>http://qlj.sh.cn/php/20100418/easy-jqueryajax-push/</link>
		<comments>http://qlj.sh.cn/php/20100418/easy-jqueryajax-push/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 13:53:46 +0000</pubDate>
		<dc:creator>qlj</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[push]]></category>

		<guid isPermaLink="false">http://qlj.sh.cn/?p=1073</guid>
		<description><![CDATA[哈。刚接触jquery
以前连JAVASCRIPT都不会。
JQUERY好方便。很容易理解。
几行代码就足够搞定了


		function checknewpm&#40;&#41;&#123;
             $.get&#40;&#34;pm.php?view=checknew&#34;, function&#40;data&#41;&#123;
$&#40;&#34;#npm&#34;&#41;.html&#40;data&#41;&#125;&#41;;
		&#125;
setInterval&#40;&#34;checknewpm()&#34;,60000&#41;;

PHP部分

$query = $db-&#62;query&#40;&#34;SELECT COUNT(pmid) from qlj_pm where tuid='{$qljid}' and isred ='0'&#34;&#41;;
$newpm= $db-&#62;result&#40;$query, 0&#41;;
if&#40;$newpm==0&#41;&#123;
$newpm=&#34;&#34;;
&#125;
echo $newpm;//就一个数字。不需要JSON了。。嘿嘿。懒。

简单方便。哈哈。。。
]]></description>
			<content:encoded><![CDATA[<p>哈。刚接触jquery<br />
以前连JAVASCRIPT都不会。<br />
JQUERY好方便。很容易理解。<br />
几行代码就足够搞定了<br />
<span id="more-1073"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">		<span style="color: #003366; font-weight: bold;">function</span> checknewpm<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
             $.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;pm.php?view=checknew&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#npm&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
setInterval<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;checknewpm()&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">60000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>PHP部分</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT COUNT(pmid) from qlj_pm where tuid='<span style="color: #006699; font-weight: bold;">{$qljid}</span>' and isred ='0'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newpm</span><span style="color: #339933;">=</span> <span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">result</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$newpm</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$newpm</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$newpm</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//就一个数字。不需要JSON了。。嘿嘿。懒。</span></pre></div></div>

<p>简单方便。哈哈。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://qlj.sh.cn/php/20100418/easy-jqueryajax-push/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery的Ajax使用笔记 转</title>
		<link>http://qlj.sh.cn/web/20100317/jquery-ajax-jieshao/</link>
		<comments>http://qlj.sh.cn/web/20100317/jquery-ajax-jieshao/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 16:35:18 +0000</pubDate>
		<dc:creator>qlj</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://qlj.sh.cn/?p=1030</guid>
		<description><![CDATA[jquery
1、代码简练、语义易懂、学习快速、文档丰富。
2、jQuery是一个轻量级的脚本，其代码非常小巧，最新版的java script包只有20K左右。
3、jQuery支持CSS1-CSS3,以及基本的xPath。
4、jQuery是跨浏览器的，它支持的浏览器包括IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+。
5、可以很容易的为jQuery扩展其他功能。
6、能将JS代码和HTML代码完全分离，便于代码和维护和修改。
7、插件丰富，除了jQuery本身带有的一些特效外，可以通过插件实现更多功能，如表单验证、tab导航、拖放效果、表格排序、
DataGrid，树形菜单、图像特效以及ajax上传等。
jQuery的设计会改变你写java script代码的方式，降低你学习使用JS操作网页的复杂度，提高网页JS开发效率，无论对于js初学者还
是资深专家，jQuery都将是您的首选。
jQuery适合于设计师、开发者以及那些还好者，同样适合用于商业开发，可以说jQuery适合任何java script应用的地方，可用于不同
的Web应用程序中。

使用方法
在需要使用JQuery的页面中引入JQuery的js文件即可。
例如：
引入之后便可在页面的任意地方使用jQuery提供的语法。
三、学习教程及参考资料
请参照《jQuery中文API手册》和http://jquery.org.cn/visual/cn/index.xml
推荐两篇不错的jquery教程：《jQuery的起点教程》和《使用 jQuery 简化 Ajax 开发》
四、语法总结和注意事项
1、关于页面元素的引用
通过jquery的$()引用元素包括通过id、class、元素名以及元素的层级关系及dom或者xpath条件等方法，且返回的对象为jquery对象
（集合对象），不能直接调用dom定义的方法。
2、jQuery对象与dom对象的转换
只有jquery对象才能使用jquery定义的方法。注意dom对象和jquery对象是有区别的，调用方法时要注意操作的是dom对象还是jquery
对象。
普通的dom对象一般可以通过$()转换成jquery对象。
如：$(document.getElementById(&#8220;msg&#8221;))则为jquery对象，可以使用jquery的方法。
由于jquery对象本身是一个集合。所以如果jquery对象要转换为dom对象则必须取出其中的某一项，一般可通过索引取出。
如：$(&#8220;#msg&#8221;)[0]，$(&#8220;div&#8221;).eq(1)[0]，$(&#8220;div&#8221;).get()[1]，$(&#8220;td&#8221;)[5]这些都是dom对象，可以使用dom中的方法，但不能再使用
Jquery的方法。
以下几种写法都是正确的：
$(&#8220;#msg&#8221;).html();
$(&#8220;#msg&#8221;)[0].innerHTML;
$(&#8220;#msg&#8221;).eq(0)[0].innerHTML;
$(&#8220;#msg&#8221;).get(0).innerHTML;
3、如何获取jQuery集合的某一项
对于获取的元素集合，获取其中的某一项（通过索引指定）可以使用eq或get(n)方法或者索引号获取，要注意，eq返回的是jquery对
象，而get(n)和索引返回的是dom元素对象。对于jquery对象只能使用jquery的方法，而dom对象只能使用dom的方法，如要获取第三
个
元素的内容。有如下两种方法：
$(&#8220;div&#8221;).eq(2).html();     //调用jquery对象的方法
$(&#8220;div&#8221;).get(2).innerHTML;   //调用dom的方法属性
4、同一函数实现set和get
Jquery中的很多方法都是如此，主要包括如下几个：
$(&#8220;#msg&#8221;).html();     //返回id为msg的元素节点的html内容。
$(&#8220;#msg&#8221;).html(&#8220;new content&#8220;);
//将“new content” 作为html串写入id为msg的元素节点内容中,页面显示粗体的new content
$(&#8220;#msg&#8221;).text();     //返回id为msg的元素节点的文本内容。
$(&#8220;#msg&#8221;).text(&#8220;new content&#8220;);
//将“new content” 作为普通文本串写入id为msg的元素节点内容中,页面显示new content
$(&#8220;#msg&#8221;).height();     //返回id为msg的元素的高度
$(&#8220;#msg&#8221;).height(&#8220;300&#8243;);   //将id为msg的元素的高度设为300
$(&#8220;#msg&#8221;).width();     //返回id为msg的元素的宽度
$(&#8220;#msg&#8221;).width(&#8220;300&#8243;);  [...]]]></description>
			<content:encoded><![CDATA[<p>jquery<br />
1、代码简练、语义易懂、学习快速、文档丰富。<br />
2、jQuery是一个轻量级的脚本，其代码非常小巧，最新版的java script包只有20K左右。<br />
3、jQuery支持CSS1-CSS3,以及基本的xPath。<br />
4、jQuery是跨浏览器的，它支持的浏览器包括IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+。<br />
5、可以很容易的为jQuery扩展其他功能。<br />
6、能将JS代码和HTML代码完全分离，便于代码和维护和修改。<br />
7、插件丰富，除了jQuery本身带有的一些特效外，可以通过插件实现更多功能，如表单验证、tab导航、拖放效果、表格排序、<br />
DataGrid，树形菜单、图像特效以及ajax上传等。<br />
jQuery的设计会改变你写java script代码的方式，降低你学习使用JS操作网页的复杂度，提高网页JS开发效率，无论对于js初学者还<br />
是资深专家，jQuery都将是您的首选。<br />
jQuery适合于设计师、开发者以及那些还好者，同样适合用于商业开发，可以说jQuery适合任何java script应用的地方，可用于不同<br />
的Web应用程序中。<br />
<span id="more-1030"></span><br />
使用方法<br />
在需要使用JQuery的页面中引入JQuery的js文件即可。<br />
例如：<script type="text/java script" src="js/jquery.js"></script><br />
引入之后便可在页面的任意地方使用jQuery提供的语法。<br />
三、学习教程及参考资料<br />
请参照《jQuery中文API手册》和http://jquery.org.cn/visual/cn/index.xml<br />
推荐两篇不错的jquery教程：《jQuery的起点教程》和《使用 jQuery 简化 Ajax 开发》</p>
<p>四、语法总结和注意事项<br />
1、关于页面元素的引用<br />
通过jquery的$()引用元素包括通过id、class、元素名以及元素的层级关系及dom或者xpath条件等方法，且返回的对象为jquery对象<br />
（集合对象），不能直接调用dom定义的方法。<br />
2、jQuery对象与dom对象的转换<br />
只有jquery对象才能使用jquery定义的方法。注意dom对象和jquery对象是有区别的，调用方法时要注意操作的是dom对象还是jquery<br />
对象。<br />
普通的dom对象一般可以通过$()转换成jquery对象。<br />
如：$(document.getElementById(&#8220;msg&#8221;))则为jquery对象，可以使用jquery的方法。<br />
由于jquery对象本身是一个集合。所以如果jquery对象要转换为dom对象则必须取出其中的某一项，一般可通过索引取出。<br />
如：$(&#8220;#msg&#8221;)[0]，$(&#8220;div&#8221;).eq(1)[0]，$(&#8220;div&#8221;).get()[1]，$(&#8220;td&#8221;)[5]这些都是dom对象，可以使用dom中的方法，但不能再使用<br />
Jquery的方法。<br />
以下几种写法都是正确的：<br />
$(&#8220;#msg&#8221;).html();<br />
$(&#8220;#msg&#8221;)[0].innerHTML;<br />
$(&#8220;#msg&#8221;).eq(0)[0].innerHTML;<br />
$(&#8220;#msg&#8221;).get(0).innerHTML;<br />
3、如何获取jQuery集合的某一项<br />
对于获取的元素集合，获取其中的某一项（通过索引指定）可以使用eq或get(n)方法或者索引号获取，要注意，eq返回的是jquery对<br />
象，而get(n)和索引返回的是dom元素对象。对于jquery对象只能使用jquery的方法，而dom对象只能使用dom的方法，如要获取第三<br />
个
<div>元素的内容。有如下两种方法：<br />
$(&#8220;div&#8221;).eq(2).html();     //调用jquery对象的方法<br />
$(&#8220;div&#8221;).get(2).innerHTML;   //调用dom的方法属性<br />
4、同一函数实现set和get<br />
Jquery中的很多方法都是如此，主要包括如下几个：<br />
$(&#8220;#msg&#8221;).html();     //返回id为msg的元素节点的html内容。<br />
$(&#8220;#msg&#8221;).html(&#8220;<b>new content</b>&#8220;);<br />
//将“<b>new content</b>” 作为html串写入id为msg的元素节点内容中,页面显示粗体的new content<br />
$(&#8220;#msg&#8221;).text();     //返回id为msg的元素节点的文本内容。<br />
$(&#8220;#msg&#8221;).text(&#8220;<b>new content</b>&#8220;);<br />
//将“<b>new content</b>” 作为普通文本串写入id为msg的元素节点内容中,页面显示<b>new content</b><br />
$(&#8220;#msg&#8221;).height();     //返回id为msg的元素的高度<br />
$(&#8220;#msg&#8221;).height(&#8220;300&#8243;);   //将id为msg的元素的高度设为300<br />
$(&#8220;#msg&#8221;).width();     //返回id为msg的元素的宽度<br />
$(&#8220;#msg&#8221;).width(&#8220;300&#8243;);   //将id为msg的元素的宽度设为300<br />
$(&#8220;input&#8221;).val(&#8220;);   //返回表单输入框的value值<br />
$(&#8220;input&#8221;).val(&#8220;test&#8221;);   //将表单输入框的value值设为test<br />
$(&#8220;#msg&#8221;).click();   //触发id为msg的元素的单击事件<br />
$(&#8220;#msg&#8221;).click(fn);   //为id为msg的元素单击事件添加函数<br />
同样blur,focus,select,submit事件都可以有着两种调用方法<br />
5、集合处理功能<br />
对于jquery返回的集合内容无需我们自己循环遍历并对每个对象分别做处理，jquery已经为我们提供的很方便的方法进行集合的处理<br />
。<br />
包括两种形式：<br />
$(&#8220;p&#8221;).each(function(i){this.style.color=['#f00','#0f0','#00f'][i]})<br />
//为索引分别为0，1，2的p元素分别设定不同的字体颜色。<br />
$(&#8220;tr&#8221;).each(function(i){this.style.backgroundColor=['#ccc','#fff'][i%2]})<br />
//实现表格的隔行换色效果<br />
$(&#8220;p&#8221;).click(function(){alert($(this).html())})<br />
//为每个p元素增加了click事件，单击某个p元素则弹出其内容<br />
6、扩展我们需要的功能<br />
$.extend({<br />
   min: function(a, b){return a < b?a:b; },<br />
   max: function(a, b){return a > b?a:b; }<br />
});   //为jquery扩展了min,max两个方法<br />
使用扩展的方法（通过“$.方法名”调用）：<br />
alert(&#8220;a=10,b=20,max=&#8221;+$.max(10,20)+&#8221;,min=&#8221;+$.min(10,20));<br />
7、支持方法的连写<br />
所谓连写，即可以对一个jquery对象连续调用各种不同的方法。<br />
例如：<br />
$(&#8220;p&#8221;).click(function(){alert($(this).html())})<br />
.mouseover(function(){alert(&#8216;mouse over event&#8217;)})<br />
.each(function(i){this.style.color=['#f00','#0f0','#00f'][i]});<br />
8、操作元素的样式<br />
主要包括以下几种方式：<br />
$(&#8220;#msg&#8221;).css(&#8220;background&#8221;);     //返回元素的背景颜色<br />
$(&#8220;#msg&#8221;).css(&#8220;background&#8221;,&#8221;#ccc&#8221;)   //设定元素背景为灰色<br />
$(&#8220;#msg&#8221;).height(300); $(&#8220;#msg&#8221;).width(&#8220;200&#8243;);   //设定宽高<br />
$(&#8220;#msg&#8221;).css({ color: &#8220;red&#8221;, background: &#8220;blue&#8221; });//以名值对的形式设定样式<br />
$(&#8220;#msg&#8221;).addClass(&#8220;select&#8221;);   //为元素增加名称为select的class<br />
$(&#8220;#msg&#8221;).removeClass(&#8220;select&#8221;);   //删除元素名称为select的class<br />
$(&#8220;#msg&#8221;).toggleClass(&#8220;select&#8221;);   //如果存在（不存在）就删除（添加）名称为select的class<br />
9、完善的事件处理功能<br />
Jquery已经为我们提供了各种事件处理方法，我们无需在html元素上直接写事件，而可以直接为通过jquery获取的对象添加事件。<br />
如：<br />
$(&#8220;#msg&#8221;).click(function(){alert(&#8220;good&#8221;)})   //为元素添加了单击事件<br />
$(&#8220;p&#8221;).click(function(i){this.style.color=['#f00','#0f0','#00f'][i]})<br />
//为三个不同的p元素单击事件分别设定不同的处理<br />
jQuery中几个自定义的事件：<br />
（1）hover(fn1,fn2)：一个模仿悬停事件（鼠标移动到一个对象上面及移出这个对象）的方法。当鼠标移动到一个匹配的元素上面<br />
时，会触发指定的第一个函数。当鼠标移出这个元素时，会触发指定的第二个函数。<br />
//当鼠标放在表格的某行上时将class置为over，离开时置为out。<br />
$(&#8220;tr&#8221;).hover(function(){<br />
$(this).addClass(&#8220;over&#8221;);<br />
},<br />
   function(){<br />
   $(this).addClass(&#8220;out&#8221;);<br />
});<br />
（2）ready(fn):当DOM载入就绪可以查询及操纵时绑定一个要执行的函数。<br />
$(document).ready(function(){alert(&#8220;Load Success&#8221;)})<br />
//页面加载完毕提示“Load Success”,相当于onload事件。与$(fn)等价<br />
（3）toggle(evenFn,oddFn): 每次点击时切换要调用的函数。如果点击了一个匹配的元素，则触发指定的第一个函数，当再次点击<br />
同一元素时，则触发指定的第二个函数。随后的每次点击都重复对这两个函数的轮番调用。<br />
   //每次点击时轮换添加和删除名为selected的class。<br />
   $(&#8220;p&#8221;).toggle(function(){<br />
     $(this).addClass(&#8220;selected&#8221;);<br />
   },function(){<br />
     $(this).removeClass(&#8220;selected&#8221;);<br />
   });<br />
（4）trigger(eventtype): 在每一个匹配的元素上触发某类事件。<br />
例如：<br />
   $(&#8220;p&#8221;).trigger(&#8220;click&#8221;);     //触发所有p元素的click事件<br />
（5）bind(eventtype,fn)，unbind(eventtype): 事件的绑定与反绑定<br />
从每一个匹配的元素中（添加）删除绑定的事件。<br />
例如：<br />
$(&#8220;p&#8221;).bind(&#8220;click&#8221;, function(){alert($(this).text());});   //为每个p元素添加单击事件<br />
$(&#8220;p&#8221;).unbind();   //删除所有p元素上的所有事件<br />
$(&#8220;p&#8221;).unbind(&#8220;click&#8221;)   //删除所有p元素上的单击事件<br />
10、几个实用特效功能<br />
其中toggle()和slidetoggle()方法提供了状态切换功能。<br />
如toggle()方法包括了hide()和show()方法。<br />
slideToggle()方法包括了slideDown()和slideUp方法。<br />
11、几个有用的jQuery方法<br />
$.browser.浏览器类型：检测浏览器类型。有效参数：safari, opera, msie, mozilla。如检测是否ie：$.browser.isie，是ie浏览<br />
器则返回true。<br />
$.each(obj, fn)：通用的迭代函数。可用于近似地迭代对象和数组（代替循环）。<br />
如<br />
$.each( [0,1,2], function(i, n){ alert( &#8220;Item #&#8221; + i + &#8220;: &#8221; + n ); });<br />
等价于：<br />
var tempArr=[0,1,2];<br />
for(var i=0;i<tempArr.length;i++){<br />
   alert(&#8220;Item #&#8221;+i+&#8221;: &#8220;+tempArr[i]);<br />
}<br />
也可以处理json数据，如<br />
$.each( { name: &#8220;John&#8221;, lang: &#8220;JS&#8221; }, function(i, n){ alert( &#8220;Name: &#8221; + i + &#8220;, Value: &#8221; + n ); });<br />
结果为：<br />
Name:name, Value:John<br />
Name:lang, Value:JS<br />
$.extend(target,prop1,propN)：用一个或多个其他对象来扩展一个对象，返回这个被扩展的对象。这是jquery实现的继承方式。<br />
如：<br />
$.extend(settings, options);<br />
//合并settings和options，并将合并结果返回settings中，相当于options继承setting并将继承结果保存在setting中。<br />
var settings = $.extend({}, defaults, options);<br />
//合并defaults和options，并将合并结果返回到setting中而不覆盖default内容。<br />
可以有多个参数（合并多项并返回）<br />
$.map(array, fn)：数组映射。把一个数组中的项目(处理转换后)保存到到另一个新数组中，并返回生成的新数组。<br />
如：<br />
var tempArr=$.map( [0,1,2], function(i){ return i + 4; });<br />
tempArr内容为：[4,5,6]<br />
var tempArr=$.map( [0,1,2], function(i){ return i > 0 ? i + 1 : null; });<br />
tempArr内容为：[2,3]<br />
$.merge(arr1,arr2):合并两个数组并删除其中重复的项目。<br />
如：$.merge( [0,1,2], [2,3,4] )   //返回[0,1,2,3,4]<br />
$.trim(str)：删除字符串两端的空白字符。<br />
如：$.trim(&#8221;   hello, how are you?   &#8220;);   //返回&#8221;hello,how are you? &#8220;<br />
12、解决自定义方法或其他类库与jQuery的冲突<br />
很多时候我们自己定义了$(id)方法来获取一个元素，或者其他的一些js类库如prototype也都定义了$方法，如果同时把这些内容放<br />
在一起就会引起变量方法定义冲突，Jquery对此专门提供了方法用于解决此问题。<br />
使用jquery中的jQuery.noConflict();方法即可把变量$的控制权让渡给第一个实现它的那个库或之前自定义的$方法。之后应用<br />
Jquery的时候只要将所有的$换成jQuery即可，如原来引用对象方法$(&#8220;#msg&#8221;)改为jQuery(&#8220;#msg&#8221;)。<br />
如：<br />
jQuery.noConflict();<br />
// 开始使用jQuery<br />
jQuery(&#8220;div   p&#8221;).hide();<br />
// 使用其他库的 $()<br />
$(&#8220;content&#8221;).style.display = &#8216;none&#8217;;</p>
]]></content:encoded>
			<wfw:commentRss>http://qlj.sh.cn/web/20100317/jquery-ajax-jieshao/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一个jquery-ajax post例子ajax 登陆</title>
		<link>http://qlj.sh.cn/web/20100317/a-jquery-ajax/</link>
		<comments>http://qlj.sh.cn/web/20100317/a-jquery-ajax/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 16:23:15 +0000</pubDate>
		<dc:creator>qlj</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://qlj.sh.cn/?p=1026</guid>
		<description><![CDATA[这个例子网上应该满多的
学习笔记 转载
index.html文件

&#60;html&#62; 
&#60;head&#62; 
&#60;title&#62;jQuery Ajax 实例演示&#60;/title&#62; 
&#60;/head&#62; 
&#60;script src=&#34;./js/jquery.js&#34; type=&#34;text/java script&#34;&#62;&#60;/script&#62;  
&#60;script type=&#34;text/java script&#34;&#62;
$(document).ready(function(){//这个就是jQueryready  ，它就像C语言的main 所有操作包含在它里面
    $(&#34;#button_login&#34;).mousedown(function(){ 
   login(); //点击ID为&#34;button_login&#34;的按钮后触发函数 login();
    });
});
function login(){ //函数 login();
 var username = $(&#34;#username&#34;).val();//取框中的用户名
 var password = $(&#34;#password&#34;).val();//取框中的密码
 $.ajax({ //一个Ajax过程  
   type: &#34;post&#34;,  //以post方式与后台沟通
   [...]]]></description>
			<content:encoded><![CDATA[<p>这个例子网上应该满多的<br />
学习笔记 转载<br />
index.html文件</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>jQuery Ajax 实例演示<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;./js/jquery.js&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/java script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/java script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
$(document).ready(function(){//这个就是jQueryready  ，它就像C语言的main 所有操作包含在它里面
    $(&quot;#button_login&quot;).mousedown(function(){ 
   login(); //点击ID为&quot;button_login&quot;的按钮后触发函数 login();
    });
});
function login(){ //函数 login();
 var username = $(&quot;#username&quot;).val();//取框中的用户名
 var password = $(&quot;#password&quot;).val();//取框中的密码
 $.ajax({ //一个Ajax过程  
   type: &quot;post&quot;,  //以post方式与后台沟通
   url : &quot;login.php&quot;, //与此php页面沟通
   dataType:'json',//从php返回的值以 JSON方式 解释
   data:  'username='+username+'<span style="color: #ddbb00;">&amp;password='+password, //发给php的数据有两项，分别是上面传来的u和p   </span>
<span style="color: #ddbb00;">   success: function(json){//如果调用php成功</span>
&nbsp;
<span style="color: #ddbb00;">                        //alert(json.username+'\n'+json.password);</span> //把php中的返回值（json.username）给 alert出来
&nbsp;
   $('#result').html(&quot;姓名:&quot; + json.username + &quot;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>密码:&quot; + json.password); //把php中的返回值显示在预定义的result
定位符位置 
&nbsp;
&nbsp;
                          }   
           });
&nbsp;
&nbsp;
&nbsp;
  //$.post()方式：  
  $('#test_post').mousedown(function (){  
    $.post(  
      'login.php',  
      {  
        username:$('#username').val(),  
        password:$('#password').val() 
      },  
      function (data) //回传函数  
      {  
        var myjson='';  
        eval('myjson=' + data + ';');  
        $('#result').html(&quot;姓名1:&quot; + myjson.username + &quot;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>密码1:&quot; + myjson.password);  
      }  
    );  
   }); 
&nbsp;
&nbsp;
&nbsp;
  //$.get()方式：  
  $('#test_get').mousedown(function ()  
  {  
    $.get(  
      'login.php',  
      {  
        username:$('#username').val(),  
        password:$('#password').val() 
      },  
      function(data) //回传函数  
      {  
        var myjson='';  
        eval(&quot;myjson=&quot; + data + &quot;;&quot;);  
        $('#result').html(&quot;姓名2:&quot; + myjson.username + &quot;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>密码2:&quot; + myjson.password);   
      }  
    );  
  });  
&nbsp;
&nbsp;
&nbsp;
&nbsp;
 }
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;result&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;background:orange;border:1px solid red;width:300px;height:200px;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;formtest&quot;</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;post&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>输入姓名:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>输入密码:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;button_login&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>ajax提交<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;test_post&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>post提交<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;test_get&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>get提交<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
&nbsp;
&nbsp;
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>login.php文件</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">json_encode</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'username'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'password'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://qlj.sh.cn/web/20100317/a-jquery-ajax/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>php jquery ajax中文乱码</title>
		<link>http://qlj.sh.cn/php/20100316/php-jquery-ajax-luanma/</link>
		<comments>http://qlj.sh.cn/php/20100316/php-jquery-ajax-luanma/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 08:12:58 +0000</pubDate>
		<dc:creator>qlj</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://qlj.sh.cn/?p=1024</guid>
		<description><![CDATA[PHP发送中文、Ajax接收
只需在php顶部加入一句：

header&#40;'Content-type: text/html;charset=GB2312'&#41;;

xmlHttp会正确解析其中的中文。
Ajax发送中文、PHP接收
这个比较复杂：
Ajax中先用encodeURIComponent对要提交的中文进行编码
PHP中：

$view=iconv&#40; 'UTF-8', 'gb2312//IGNORE' , $_POST&#91;'view'&#93;&#41;;

]]></description>
			<content:encoded><![CDATA[<p>PHP发送中文、Ajax接收<br />
只需在php顶部加入一句：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: text/html;charset=GB2312'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>xmlHttp会正确解析其中的中文。</p>
<p>Ajax发送中文、PHP接收<br />
这个比较复杂：<br />
Ajax中先用encodeURIComponent对要提交的中文进行编码<br />
PHP中：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$view</span><span style="color: #339933;">=</span><span style="color: #990000;">iconv</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'UTF-8'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'gb2312//IGNORE'</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://qlj.sh.cn/php/20100316/php-jquery-ajax-luanma/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>thickbox关闭时自动刷新父页</title>
		<link>http://qlj.sh.cn/web/20090928/thickbox-reload/</link>
		<comments>http://qlj.sh.cn/web/20090928/thickbox-reload/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 15:32:33 +0000</pubDate>
		<dc:creator>qlj</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[thickbox]]></category>

		<guid isPermaLink="false">http://qlj.sh.cn/?p=838</guid>
		<description><![CDATA[thickbox 确实很好用啊
尤其是我这种美工差的。。
可以做一个简单的页面。。
用上THICKBOX 只显示这一个部分就OK 了

关闭是自动刷新父窗口
比如我用在投票，留言，发表后 点关闭 直接刷新。马上看到新内容
function tb_remove() {
$(&#8220;#TB_imageOff&#8221;).unbind(&#8220;click&#8221;);
$(&#8220;#TB_closeWindowButton&#8221;).unbind(&#8220;click&#8221;);
$(&#8220;#TB_window&#8221;).fadeOut(&#8220;fast&#8221;,function(){$(&#8216;#TB_window,#TB_overlay,#TB_HideSelect&#8217;).trigger(&#8220;unload&#8221;).unbind().remove();});
$(&#8220;#TB_load&#8221;).remove();
if (typeof document.body.style.maxHeight == &#8220;undefined&#8221;) {//if IE 6
$(&#8220;body&#8221;,&#8221;html&#8221;).css({height: &#8220;auto&#8221;, width: &#8220;auto&#8221;});
$(&#8220;html&#8221;).css(&#8220;overflow&#8221;,&#8221;");
}
window.location.reload();
document.onkeydown = &#8220;&#8221;;
document.onkeyup = &#8220;&#8221;;
return false;
}
window.location.reload();
中间加上这个就OK 了
如果闲他影响速度
自己去掉
]]></description>
			<content:encoded><![CDATA[<p>thickbox 确实很好用啊<br />
尤其是我这种美工差的。。<br />
可以做一个简单的页面。。<br />
用上<a href="http://qlj.sh.cn/tag/thickbox">THICKBOX</a> 只显示这一个部分就OK 了<br />
<span id="more-838"></span><br />
关闭是自动刷新父窗口<br />
比如我用在投票，留言，发表后 点关闭 直接刷新。马上看到新内容<br />
function tb_remove() {<br />
$(&#8220;#TB_imageOff&#8221;).unbind(&#8220;click&#8221;);<br />
$(&#8220;#TB_closeWindowButton&#8221;).unbind(&#8220;click&#8221;);<br />
$(&#8220;#TB_window&#8221;).fadeOut(&#8220;fast&#8221;,function(){$(&#8216;#TB_window,#TB_overlay,#TB_HideSelect&#8217;).trigger(&#8220;unload&#8221;).unbind().remove();});<br />
$(&#8220;#TB_load&#8221;).remove();<br />
if (typeof document.body.style.maxHeight == &#8220;undefined&#8221;) {//if IE 6<br />
$(&#8220;body&#8221;,&#8221;html&#8221;).css({height: &#8220;auto&#8221;, width: &#8220;auto&#8221;});<br />
$(&#8220;html&#8221;).css(&#8220;overflow&#8221;,&#8221;");<br />
}<br />
<strong>window.location.reload();</strong><br />
document.onkeydown = &#8220;&#8221;;<br />
document.onkeyup = &#8220;&#8221;;<br />
return false;<br />
}</p>
<p><span style="color: #ff0000;">window.location.reload();</span></p>
<p>中间加上这个就OK 了</p>
<p>如果闲他影响速度<br />
自己去掉</p>
]]></content:encoded>
			<wfw:commentRss>http://qlj.sh.cn/web/20090928/thickbox-reload/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>漂亮的jquery 相册 Galleriffic</title>
		<link>http://qlj.sh.cn/web/20090928/jquery-galleriffic/</link>
		<comments>http://qlj.sh.cn/web/20090928/jquery-galleriffic/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 13:23:13 +0000</pubDate>
		<dc:creator>qlj</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[Galleriffic]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://qlj.sh.cn/?p=835</guid>
		<description><![CDATA[Galleriffic是一个用于创建快速展示相册中照片的jQuery插件。图片既可以以幻灯片的方式查看，也可以手动点击缩略图查看。Galleriffic还支持分页，从而使得它能够展示更多的图片。
这个jQuery插件为你的照片生成一个精致的缩略图列表，点击缩略图就可以快速查看适当尺寸的预览图了。同时它还提供了原始尺寸图片的下载方式，我觉得用这个插件来制作相册的效果非常好。


演示地址：
http://qfclub.qphome.com/hyfc/
官方网站

http://www.twospy.com/galleriffic/

很漂亮。
但是发现个问题
不知道如何 强制 图片大小
某些图片太大。
]]></description>
			<content:encoded><![CDATA[<p>Galleriffic是一个用于创建快速展示相册中照片的jQuery插件。图片既可以以幻灯片的方式查看，也可以手动点击缩略图查看。Galleriffic还支持分页，从而使得它能够展示更多的图片。<br />
这个jQuery插件为你的照片生成一个精致的缩略图列表，点击缩略图就可以快速查看适当尺寸的预览图了。同时它还提供了原始尺寸图片的下载方式，我觉得用这个插件来制作相册的效果非常好。</p>
<p><span id="more-835"></span><br />
<img alt="" src="http://upfile.case-mod.net/www.case-mod.net/2009/Sep/qlj.sh.cn1254143977.jpg" title="galleriffic" class="alignnone" width="640" height="480" /><br />
演示地址：<br />
<a href="http://qfclub.qphome.com/hyfc/">http://qfclub.qphome.com/hyfc/</a></p>
<p>官方网站<br />

http://www.twospy.com/galleriffic/</p>

<p>很漂亮。<br />
但是发现个问题<br />
不知道如何 强制 图片大小<br />
某些图片太大。</p>
]]></content:encoded>
			<wfw:commentRss>http://qlj.sh.cn/web/20090928/jquery-galleriffic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

