﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>PHP博客-为了忘却的纪念   $bestmost-&gt;save("多多益善")-随笔分类-ajax</title><link>http://www.phpweblog.net/fuyongjie/category/503.html</link><description>言己及众</description><language>zh-cn</language><lastBuildDate>Thu, 02 Sep 2010 17:04:48 GMT</lastBuildDate><pubDate>Thu, 02 Sep 2010 17:04:48 GMT</pubDate><ttl>60</ttl><item><title>Google AJAX Language API开发者参考</title><link>http://www.phpweblog.net/fuyongjie/archive/2008/11/19/6094.html</link><dc:creator>bestmost</dc:creator><author>bestmost</author><pubDate>Tue, 18 Nov 2008 16:51:00 GMT</pubDate><guid>http://www.phpweblog.net/fuyongjie/archive/2008/11/19/6094.html</guid><wfw:comment>http://www.phpweblog.net/fuyongjie/comments/6094.html</wfw:comment><comments>http://www.phpweblog.net/fuyongjie/archive/2008/11/19/6094.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/fuyongjie/comments/commentRss/6094.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/fuyongjie/services/trackbacks/6094.html</trackback:ping><description><![CDATA[<div class=postBody>
<p style="FONT-FAMILY: Courier">使用AJAX Language API，你可以仅使用JavaScript来完成对某个网页上某个区域的语言进行翻译和检测的工作。这个API是新开发的，因此相对于一个完美的文档来说，可能有一些bug和微小的不足。我们会修补这些漏洞，因此请谅解、你可以加入<a href="http://groups.google.com/group/Google-AJAX-Search-API" target=_new>AJAX APIs开发者论坛</a>来给我们反馈和讨论这个API。</p>
<p style="FONT-FAMILY: Courier">面向读者</p>
<p style="FONT-FAMILY: Courier">本文档是面向对JavaScript编程和面向对象编程概念有所了解的人准备的。在互联网上有很多<a href="http://www.google.com/search?q=javascript+tutorials" target=_new>JavaScript教程</a>。</p>
<p style="FONT-FAMILY: Courier">介绍</p>
<p style="FONT-FAMILY: Courier">在Google Ajax Language API上的&#8220;Hello,World&#8221;程序</p>
<p style="FONT-FAMILY: Courier">开始学习本API的最简单方法是来看一个简单的例子，一下案例将检测给定语言，并且将其翻译为英文。</p>
<pre>&nbsp;&nbsp;&lt;head&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;script type="text/javascript"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;google.load("language", "1");
&nbsp;&nbsp;&nbsp;&nbsp;function initialize() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var text = document.getElementById("text").innerHTML;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;google.language.detect(text, function(result) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!result.error &amp;&amp; result.language) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;google.language.translate(text, result.language, "en",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function(result) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var translated = document.getElementById("translation");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (result.translation) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;translated.innerHTML = result.translation;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;google.setOnLoadCallback(initialize);
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/script&gt;
&nbsp;&nbsp;&lt;/head&gt;
&nbsp;&nbsp;&lt;body&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="text"&gt;你好，很高興見到你。&lt;/div&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="translation"&gt;&lt;/div&gt;
&nbsp;&nbsp;&lt;/body&gt;
</pre>
<p style="FONT-FAMILY: Courier">你可以在<a href="http://code.google.com/apis/ajaxlanguage/documentation/helloworld.html" target=_new>这里查看该案例</a>，并且随意修改和运行它。</p>
<p style="FONT-FAMILY: Courier">在你的网页中包含Ajax Language API</p>
<p style="FONT-FAMILY: Courier">为了在你的网页中加入AJAX Language API，你需要利用<a href="http://code.google.com/apis/ajax/documentation/" target=_new>Google AJAX API Loader</a>。该公有加载类允许你加载你所需要的所有AJAX API，包括这里的language API。你需要同时包含Google AJAX APIs的script标签并且调用google.load(&#8221;language&#8221;,&#8221;1&#8243;);。</p>
<pre>&lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
&nbsp;&nbsp;google.load("language", "1");
&lt;/script&gt;</pre>
<p style="FONT-FAMILY: Courier">第一个script标签加载了google.load函数，这个函数允许你加载特定的 Google API。google.load(&#8221;language&#8221;,&#8221;1&#8243;)加载了Language API的第一版。当前，AJAX Language API的版本为1，但是不久后新版本将可以使用。参考下面的<a href="http://code.google.com/apis/ajaxlanguage/documentation/#Versioning" target=_new>版本讨论</a>来获得更多信息。</p>
<p style="FONT-FAMILY: Courier">API 更新</p>
<p style="FONT-FAMILY: Courier">google.load函数的第二个参数实际上是你所使用的AJAX Language API的版本。当前，AJAX Language API的版本为1，但是不久后新版本将可以使用。如果以后我们对API进行重要更新，我们将改变版本号，并且在<a href="http://code.google.com/" target=_new>Google Code</a>和<a href="http://googleajaxsearchapi.blogspot.com/" target=_new>AJAX APIS 讨论</a>中发布通知。当该事件发生后，我们预期会在至少一个月的时间内继续支持所有版本来使你有足够的时间来迁移你的代码。</p>
<p style="FONT-FAMILY: Courier">AJAX Language API团队对于最近日较的Bug修复和平台优化进行定期更新。这些Bug修复应当仅提高表现和修复Bug，但是我们有可能不小心破坏某些API用户、请使用<a href="http://googleajaxsearchapi.blogspot.com/" target=_new>AJAX APIs 讨论组</a>来报告这样的问题。</p>
<p style="FONT-FAMILY: Courier">实例</p>
<p style="FONT-FAMILY: Courier">语言翻译</p>
<p style="FONT-FAMILY: Courier">本案例展示了一个简单的对一个JavaScript字符串变量进行翻译的过程。</p>
<pre>google.language.translate("Hello world", "en", "es", function(result) {
&nbsp;&nbsp;if (!result.error) {
&nbsp;&nbsp;&nbsp;&nbsp;var container = document.getElementById("translation");
&nbsp;&nbsp;&nbsp;&nbsp;container.innerHTML = result.translation;
&nbsp;&nbsp;}
});</pre>
<p style="FONT-FAMILY: Courier"><a href="http://code.google.com/apis/ajaxlanguage/documentation/translate.html" target=_new>查看案例（translate.html）</a></p>
<p style="FONT-FAMILY: Courier">语言检测</p>
<p style="FONT-FAMILY: Courier">这个案例展示了对于一个JavaScript字符串的语言检测。将返回语言代码。</p>
<pre>var text = "?D&#243;nde est&#225; el ba?o?";
google.language.detect(text, function(result) {
&nbsp;&nbsp;if (!result.error) {
&nbsp;&nbsp;&nbsp;&nbsp;var language = 'unknown';
&nbsp;&nbsp;&nbsp;&nbsp;for (l in google.language.Languages) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (google.language.Languages[l] == result.language) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;language = l;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;var container = document.getElementById(&#8221;detection&#8221;);
&nbsp;&nbsp;&nbsp;&nbsp;container.innerHTML = text + &#8221; is: &#8221; + language + &#8220;&#8221;;
&nbsp;&nbsp;}
});</pre>
<p style="FONT-FAMILY: Courier"><a href="http://code.google.com/apis/ajaxlanguage/documentation/detection.html" target=_new>查看案例 (detection.html)</a></p>
<p style="FONT-FAMILY: Courier">翻译时源检测</p>
<p style="FONT-FAMILY: Courier">如下的案例类似于基本的翻译案例，但是它展示了如何在不知道源语言时对文本进行翻译。通过传入一个空字符串来表示未知的源语言，系统将在一次调用中自动检测和翻译。</p>
<pre>google.language.translate("Hello world", "", "es", function(result) {
&nbsp;&nbsp;if (!result.error) {
&nbsp;&nbsp;&nbsp;&nbsp;var container = document.getElementById("translation");
&nbsp;&nbsp;&nbsp;&nbsp;container.innerHTML = result.translation;
&nbsp;&nbsp;}
});</pre>
<p style="FONT-FAMILY: Courier"><a href="http://code.google.com/apis/ajaxlanguage/documentation/autotranslate.html" target=_new>查看案例 (autotranslate.html)</a></p>
<p style="FONT-FAMILY: Courier">更多案例</p>
<p style="FONT-FAMILY: Courier">这里有进行交互作用的两个附加案例：</p>
<p style="FONT-FAMILY: Courier">第一个案例对预输入的文本字符串进行语言检测，同时也允许输入其他的文本。它同时也显示信任和可靠因数（confidence and reliability factors—译者注）。<br><a href="http://www.google.com/uds/samples/language/detect.html" target=_new>查看案例(detect.html)</a></p>
<p style="FONT-FAMILY: Courier">第二个附加案例进行翻译。同时他也允许与上述类似的交互作用。<br><a href="http://www.google.com/uds/samples/language/translate.html" target=_new>查看案例(translate.html)</a></p>
<p style="FONT-FAMILY: Courier">API细节</p>
<p style="FONT-FAMILY: Courier">支持的语言</p>
<p style="FONT-FAMILY: Courier">Google AJAX Language API现在支持下列语言。该技术正在不断的提高，同时我们的团队也在努力的扩展这个列表，因此请经常回来看看。你也可以访问<a href="http://translate.google.com/" target=_new>Google Translate</a>来查看最近更新的列表。</p>
<p style="FONT-FAMILY: Courier">&nbsp;&nbsp;&nbsp;&nbsp;* Arabic （阿拉伯语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Chinese (Simplified and Traditional) （中文简体）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Dutch （荷兰语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English （英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* French （法语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* German （德语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Greek （希腊语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Italian （意大利语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Japanese （日语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Korean （韩语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Portuguese （葡萄牙语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Russian （俄语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Spanish（西班牙语）</p>
<p style="FONT-FAMILY: Courier">支持的语言翻译对</p>
<p style="FONT-FAMILY: Courier">Google AJAX Language API现在支持下列语言翻译对。该技术正在不断的提高，同时我们的团队也在努力的扩展这个列表，因此请经常回来看看。你也可以访问<a href="http://translate.google.com/" target=_new>Google Translate</a>来查看最近更新的列表。</p>
<p style="FONT-FAMILY: Courier">&nbsp;&nbsp;&nbsp;&nbsp;* Arabic to English （阿拉伯语到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Chinese to English （中文到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Chinese (Simplified to Traditional) （简体中文到繁体中文）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Chinese (Traditional to Simplified) （繁体中文到简体中文）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Dutch to English （荷兰语到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Arabic （英语到阿拉伯语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Chinese (Simplified) （英语到简体中文）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Chinese (Traditional) （英语到繁体中文）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Dutch （英语到荷兰语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to French （英语到法语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to German （英语到德语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Greek （英语到希腊语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Italian （英语到意大利语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Japanese （英语到日语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Korean （英语到韩语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Portuguese （英语到葡萄牙语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Russian （英语到俄语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* English to Spanish （英语到西班牙语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* French to English （法语到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* French to German （法语到德语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* German to English （德语到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* German to French （德语到法语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Greek to English （希腊语到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Italian to English （意大利语到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Japanese to English （日语到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Korean to English （韩语到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Portuguese to English （葡萄牙语到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Russian to English （俄语到英语）<br>&nbsp;&nbsp;&nbsp;&nbsp;* Spanish to English（西班牙语到英语）</p>
<p style="FONT-FAMILY: Courier">问题解决</p>
<p style="FONT-FAMILY: Courier">如果在你的代码中遇到了问题：</p>
<p style="FONT-FAMILY: Courier">&nbsp;&nbsp; 1. 检查代码。请牢记JavaScript是对大小写敏感的语言。<br>&nbsp;&nbsp; 2. 使用JavaScript调试器、在Firefox中，你可以使用JavaScript控制台或者FireBug扩展。在IE中，你可以使用Microsoft Script Debugger。<br>&nbsp;&nbsp; 3. 在AJAX APIs讨论组中搜索。如果你找不到回答你问题的帖子，那么可以在讨论组中发布你的问题，并且包含指向你出问题的页面的链接。</p>
<div style="FONT-FAMILY: Courier"></div>
</div><img src ="http://www.phpweblog.net/fuyongjie/aggbug/6094.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/fuyongjie/" target="_blank">bestmost</a> 2008-11-19 00:51 <a href="http://www.phpweblog.net/fuyongjie/archive/2008/11/19/6094.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】[JGTranslation] - 基于GOOGLE AJAX API的jQuery页面即时翻译插件</title><link>http://www.phpweblog.net/fuyongjie/archive/2008/11/19/6093.html</link><dc:creator>bestmost</dc:creator><author>bestmost</author><pubDate>Tue, 18 Nov 2008 16:45:00 GMT</pubDate><guid>http://www.phpweblog.net/fuyongjie/archive/2008/11/19/6093.html</guid><wfw:comment>http://www.phpweblog.net/fuyongjie/comments/6093.html</wfw:comment><comments>http://www.phpweblog.net/fuyongjie/archive/2008/11/19/6093.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/fuyongjie/comments/commentRss/6093.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/fuyongjie/services/trackbacks/6093.html</trackback:ping><description><![CDATA[<br><img class="aligncenter size-full wp-image-149" title=jgtranslation height=127 alt="" src="http://www.evlook.com/uploads/2008/11/jgtranslation.gif" width=451>
<p>平常上网遇见不懂单词和句子的时候，都喜欢用翻译软件来翻译一下，一般都用有道和google。这几天看google API的时候发现他好像早就提供了翻译的方法，不过好像没什么人用 <img class=wp-smiley alt=:( src="http://www.evlook.com/wp-includes/images/smilies/icon_sad.gif"> 那我来用，呵呵。</p>
<p>写了个jquery的小插件，结合google ajax API，提供页面文字的即时翻译功能，只要你指定要使用即时翻译的模块ID并指定翻译语言（如果不指定就按照操作系统默认语言进行翻译。）就能简单调用，非常方便。</p>
<p>
<blockquote>如果你的blog是中文但是很多国外访问者那你可以用了试试，如果你的是英文blog，但是很多用中文的用户访问，你也可以使用。总之都是为了大家提供便利，呵呵。
<p>&nbsp;</p>
</blockquote>
<h3 style="COLOR: #06aba9">可以选择下面的两段文字看看效果</h3>
<div class=transBlock id=TS1 jQuery1227011601765="2">曲曲折折的荷塘上面，弥望的是田田的叶子。叶子出水很高，像亭亭的舞女的裙。层层的叶子中间，零星地点缀着些白花，有袅娜地开着的，有羞涩地打着朵儿的；正如一粒粒的明珠，又如碧天里的星星，又如刚出浴的美人。微风过处，送来缕缕清香，仿佛远处高楼上渺茫的歌声似的。这时候叶子与花也有一丝的颤动，像闪电一般，霎时传过荷塘的那边去了。叶子本是肩并肩密密地挨着，这便宛然有了一道凝碧的波痕。叶子底下是脉脉的流水，遮住了，不能见一些颜色；而叶子却更见风致了 </div>
<div class=transBlock id=TS2 jQuery1227011601765="4">Now that I&#8217;ve lost everything to you,<br>you say you want to start something new,<br>and it&#8217;s breaking my heart you&#8217;re leaving,<br>baby I&#8217;m grieving.<br>But if you wanna leave take good care,<br>hope you have a lot of nice things to wear,<br>but then a lot of nice things turn bad out there. </div>
<p><script>
$(document).ready(function(){
$('#TS1').JGTranslation({Language:'en'})
$('#TS2').JGTranslation()
});
</script></p>
<h4>一、你必须引用google提供的API </h4>
<div class=wp_syntax style="PADDING-BOTTOM: 15px">
<div class=code>
<pre class=html style="FONT-FAMILY: monospace">&lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
google.load("language", "1");
&lt;/script&gt;</pre>
</div>
</div>
<h4>二、翻译控件用到的默认样式</h4>
<div class=wp_syntax style="PADDING-BOTTOM: 15px">
<div class=code>
<pre class="css css" style="FONT-FAMILY: monospace"><span style="COLOR: #6666ff">.JGTranslationPopStyle</span><span style="COLOR: #00aa00">{</span><span style="FONT-WEIGHT: bold; COLOR: #000000">font</span> <span style="COLOR: #00aa00">:</span> <span style="COLOR: #993333">normal</span> <span style="COLOR: #993333">normal</span> <span style="COLOR: #993333">normal</span> <span style="COLOR: #933">12px</span> Verdana<span style="COLOR: #00aa00">,</span> Arial<span style="COLOR: #00aa00">,</span> Helvetica<span style="COLOR: #00aa00">,</span> <span style="COLOR: #993333">sans-serif</span>;border<span style="COLOR: #00aa00">:</span><span style="COLOR: #933">2px</span> <span style="COLOR: #993333">solid</span> <span style="COLOR: #cc00cc">#C5D7EF</span>;background<span style="COLOR: #00aa00">:</span><span style="COLOR: #cc00cc">#fff</span>;<span style="COLOR: #00aa00">}</span>
<span style="COLOR: #6666ff">.JGTranslationPopStyle</span> p<span style="COLOR: #00aa00">{</span><span style="FONT-WEIGHT: bold; COLOR: #000000">padding</span><span style="COLOR: #00aa00">:</span><span style="COLOR: #933">3px</span>;margin<span style="COLOR: #00aa00">:</span><span style="COLOR: #933">0px</span>;line-<span style="FONT-WEIGHT: bold; COLOR: #000000">height</span><span style="COLOR: #00aa00">:</span><span style="COLOR: #933"><span style="COLOR: #cc66cc">150</span>%</span>;<span style="COLOR: #00aa00">}</span>
<span style="COLOR: #6666ff">.JGTranslationPopStyle</span> div<span style="COLOR: #00aa00">{</span><span style="FONT-WEIGHT: bold; COLOR: #000000">text-align</span><span style="COLOR: #00aa00">:</span><span style="FONT-WEIGHT: bold; COLOR: #000000">right</span>;background<span style="COLOR: #00aa00">:</span><span style="COLOR: #cc00cc">#E5ECF9</span>;<span style="COLOR: #00aa00">}</span></pre>
</div>
</div>
<h4>三、调用方法</h4>
<div class=wp_syntax style="PADDING-BOTTOM: 0px">
<div class=code>
<pre class="javascript javascript" style="FONT-FAMILY: monospace">$<span style="COLOR: #009900">(</span>selector<span style="COLOR: #009900">)</span>.<span style="COLOR: #660066">JGTranslation</span><span style="COLOR: #009900">(</span>options<span style="COLOR: #009900">)</span>
<span style="COLOR: #006600; FONT-STYLE: italic">//可选参数</span>
<span style="COLOR: #006600; FONT-STYLE: italic">//Language:string(default = "userLanguage")</span>
<span style="COLOR: #006600; FONT-STYLE: italic">//PopStyle: string(default = "JGTranslationPopStyle")</span>
<span style="COLOR: #006600; FONT-STYLE: italic">//Branding:boolean(default = true)</span></pre>
</div>
</div>
<h4>示例：</h4>
<div class=wp_syntax style="PADDING-BOTTOM: 15px">
<div class=code>
<pre class=html style="FONT-FAMILY: monospace">&lt;div id="TS1"&gt;
曲曲折折的荷塘上面，弥望的是田田的叶子。叶子出水很高，像亭亭的舞女的裙。层层的叶子中间，零星地点缀着些白花，有袅娜地开着的，有羞涩地打着朵儿的；正如一粒粒的明珠，又如碧天里的星星，又如刚出浴的美人。微风过处，送来缕缕清香，仿佛远处高楼上渺茫的歌声似的。这时候叶子与花也有一丝的颤动，像闪电一般，霎时传过荷塘的那边去了。叶子本是肩并肩密密地挨着，这便宛然有了一道凝碧的波痕。叶子底下是脉脉的流水，遮住了，不能见一些颜色；而叶子却更见风致了
&lt;/div&gt;
&lt;div id="TS2"&gt;
Now that I've lost everything to you,
you say you want to start something new,
and it's breaking my heart you're leaving,
baby I'm grieving.
But if you wanna leave take good care,
hope you have a lot of nice things to wear,
but then a lot of nice things turn bad out there.
&lt;/div&gt;</pre>
</div>
</div>
<div class=wp_syntax style="PADDING-BOTTOM: 0px">
<div class=code>
<pre class="javascript javascript" style="FONT-FAMILY: monospace">$<span style="COLOR: #009900">(</span><span style="COLOR: #3366cc">'#TS1'</span><span style="COLOR: #009900">)</span>.<span style="COLOR: #660066">JGTranslation</span><span style="COLOR: #009900">(</span><span style="COLOR: #009900">{</span>Language<span style="COLOR: #339933">:</span><span style="COLOR: #3366cc">'en'</span><span style="COLOR: #009900">}</span><span style="COLOR: #009900">)</span>
$<span style="COLOR: #009900">(</span><span style="COLOR: #3366cc">'#TS2'</span><span style="COLOR: #009900">)</span>.<span style="COLOR: #660066">JGTranslation</span><span style="COLOR: #009900">(</span><span style="COLOR: #009900">)<br>原文加演示：<a href="http://www.evlook.com/?p=126">http://www.evlook.com/?p=126</a><br><br><br><br></span></pre>
</div>
</div><img src ="http://www.phpweblog.net/fuyongjie/aggbug/6093.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/fuyongjie/" target="_blank">bestmost</a> 2008-11-19 00:45 <a href="http://www.phpweblog.net/fuyongjie/archive/2008/11/19/6093.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>通过鼠标定位和html元素坐标及宽高实现对ajax层的隐藏与显示</title><link>http://www.phpweblog.net/fuyongjie/archive/2008/08/25/5653.html</link><dc:creator>bestmost</dc:creator><author>bestmost</author><pubDate>Mon, 25 Aug 2008 01:29:00 GMT</pubDate><guid>http://www.phpweblog.net/fuyongjie/archive/2008/08/25/5653.html</guid><wfw:comment>http://www.phpweblog.net/fuyongjie/comments/5653.html</wfw:comment><comments>http://www.phpweblog.net/fuyongjie/archive/2008/08/25/5653.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/fuyongjie/comments/commentRss/5653.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/fuyongjie/services/trackbacks/5653.html</trackback:ping><description><![CDATA[共享一个例子：（折腾了我3个多小时呀，我这里只展示了部分功能）<br><span style="color: #ffffff;">来自：</span><a style="color: #ffffff;" href="http://www.phpweblog.net/fuyongjie/admin/EditPosts.aspx?postid=5653">http://www.phpweblog.net/fuyongjie/admin/EditPosts.aspx?postid=5653
</a><br>功能：<br>&nbsp;&nbsp;&nbsp; 鼠标经过img通过ajax异步生成一个层(如：ajax_famous3），鼠标移开img但不悬浮在ajax_famous3层上，则ajax_famous3隐藏,若悬浮在了ajax_famous3上，该层不隐藏，当鼠标又移开ajax_famous3时，ajax_famous3又隐藏了<br><br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #0000ff;">1.JS代码：<br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #0000ff;">function</span><span style="color: #000000;">&nbsp;ajax_post(id)&nbsp;{<br></span><span style="color: #008000;">//</span><span style="color: #008000;">alert(id);</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;showDiv(</span><span style="color: #000000;">"</span><span style="color: #000000;">famous</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id);<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(document</span><span style="color: #000000;">.</span><span style="color: #000000;">getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">ajax_famous</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id))&nbsp;{</span><span style="color: #008000;">//</span><span style="color: #008000;">如果已经Ajax过了,就不再去Ajax</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showDiv(</span><span style="color: #000000;">"</span><span style="color: #000000;">ajax_famous</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id);<br>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</span><span style="color: #0000ff;">else</span><span style="color: #000000;">&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loading&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">div[@name=loading</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id</span><span style="color: #000000;">+</span><span style="color: #000000;">"</span><span style="color: #000000;">]</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$</span><span style="color: #000000;">.</span><span style="color: #000000;">ajax({<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">get</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">{{url&nbsp;c=Post&nbsp;a=ACompanyPosts}}</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">member_id=</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id</span><span style="color: #000000;">,</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beforeSend</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">function</span><span style="color: #000000;">(){$(loading)</span><span style="color: #000000;">.</span><span style="color: #000000;">show()}</span><span style="color: #000000;">,</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>success: function(a){if(document.getElementById("ajax_famous"+id)){return false;}else{$("#famous"+id).append(a)}}//再次确保前面没有ajax过 ,<span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complete</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">function</span><span style="color: #000000;">(){$(loading)</span><span style="color: #000000;">.</span><span style="color: #000000;">hide()}&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>}<br></span></div>
<br><br><br>function</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;getAbsPoint(e)&nbsp;&nbsp;</span><span style="color: #008000;">//</span><span style="color: #008000;">e为元素对象,获得此元素的左上角坐标(x,y)和宽、高</span><span style="color: #008000;"><br></span><span style="color: #000000;">{&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">var</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;x&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;e</span><span style="color: #000000;">.</span><span style="color: #000000;">offsetLeft</span><span style="color: #000000;">,</span><span style="color: #000000;">&nbsp;y&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;e</span><span style="color: #000000;">.</span><span style="color: #000000;">offsetTop</span><span style="color: #000000;">,</span><span style="color: #000000;">h&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;e</span><span style="color: #000000;">.</span><span style="color: #000000;">clientHeight</span><span style="color: #000000;">,</span><span style="color: #000000;">w&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;e</span><span style="color: #000000;">.</span><span style="color: #000000;">clientWidth;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">while</span><span style="color: #000000;">(e</span><span style="color: #000000;">=</span><span style="color: #000000;">e</span><span style="color: #000000;">.</span><span style="color: #000000;">offsetParent)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;</span><span style="color: #000000;">+=</span><span style="color: #000000;">&nbsp;e</span><span style="color: #000000;">.</span><span style="color: #000000;">offsetLeft;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;</span><span style="color: #000000;">+=</span><span style="color: #000000;">&nbsp;e</span><span style="color: #000000;">.</span><span style="color: #000000;">offsetTop;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">//</span><span style="color: #008000;">&nbsp;h&nbsp;+=&nbsp;e.clientHeight;</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">//</span><span style="color: #008000;">document.getElementById('x').<br>&nbsp;&nbsp;&nbsp;&nbsp;//$("#x").val(x+","+(x+w));<br>&nbsp;&nbsp;&nbsp;&nbsp;//$("#y").val(y+","+(y+h));</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">var</span><span style="color: #000000;">&nbsp;ePoint&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;{</span><span style="color: #000000;">"</span><span style="color: #000000;">l</span><span style="color: #000000;">"</span><span style="color: #000000;">:</span><span style="color: #000000;">x</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">t</span><span style="color: #000000;">"</span><span style="color: #000000;">:</span><span style="color: #000000;">y</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">h</span><span style="color: #000000;">"</span><span style="color: #000000;">:</span><span style="color: #000000;">h</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">w</span><span style="color: #000000;">"</span><span style="color: #000000;">:</span><span style="color: #000000;">w};<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">return</span><span style="color: #000000;">&nbsp;ePoint;<br>}&nbsp;&nbsp;<br><br></span><span style="color: #0000ff;">function</span><span style="color: #000000;">&nbsp;getMousePosition(event)&nbsp;{</span><span style="color: #008000;">//</span><span style="color: #008000;">获得鼠标坐标</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">var</span><span style="color: #000000;">&nbsp;x&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;event</span><span style="color: #000000;">.</span><span style="color: #000000;">clientX;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">var</span><span style="color: #000000;">&nbsp;y&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;event</span><span style="color: #000000;">.</span><span style="color: #000000;">clientY;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">!</span><span style="color: #000000;">document</span><span style="color: #000000;">.</span><span style="color: #000000;">all){</span><span style="color: #008000;">//</span><span style="color: #008000;">适用firefox</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mouse_x</span><span style="color: #000000;">=</span><span style="color: #000000;">event</span><span style="color: #000000;">.</span><span style="color: #000000;">pageX;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mouse_y</span><span style="color: #000000;">=</span><span style="color: #000000;">event</span><span style="color: #000000;">.</span><span style="color: #000000;">pageY;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;}</span><span style="color: #0000ff;">else</span><span style="color: #000000;">{</span><span style="color: #008000;">//</span><span style="color: #008000;">适用ie</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mouse_x</span><span style="color: #000000;">=</span><span style="color: #000000;">document</span><span style="color: #000000;">.</span><span style="color: #000000;">documentElement</span><span style="color: #000000;">.</span><span style="color: #000000;">scrollLeft</span><span style="color: #000000;">+</span><span style="color: #000000;">event</span><span style="color: #000000;">.</span><span style="color: #000000;">clientX;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mouse_y</span><span style="color: #000000;">=</span><span style="color: #000000;">document</span><span style="color: #000000;">.</span><span style="color: #000000;">documentElement</span><span style="color: #000000;">.</span><span style="color: #000000;">scrollTop</span><span style="color: #000000;">+</span><span style="color: #000000;">event</span><span style="color: #000000;">.</span><span style="color: #000000;">clientY;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">//</span><span style="color: #008000;">alert(document.documentElement.scrollTop);&nbsp;滚动条滚过的高度，+&nbsp;显示页面的高度原因是声明后document.body.scrollTop的值永远等于0，解决办法是只需把document.body用&nbsp;document.documentElement替换即可。</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">var</span><span style="color: #000000;">&nbsp;mouseP&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;{</span><span style="color: #000000;">"</span><span style="color: #000000;">mouse_x</span><span style="color: #000000;">"</span><span style="color: #000000;">:</span><span style="color: #000000;">mouse_x</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">mouse_y</span><span style="color: #000000;">"</span><span style="color: #000000;">:</span><span style="color: #000000;">mouse_y};<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">return</span><span style="color: #000000;">&nbsp;mouseP;<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>}<br><br><br></span><span style="color: #0000ff;">function</span><span style="color: #000000;">&nbsp;hiddenDiv(id</span><span style="color: #000000;">,</span><span style="color: #000000;">event)&nbsp;{&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">//</span><span style="color: #008000;">alert(id);</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;mouseP&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;getMousePosition(event);<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">//</span><span style="color: #008000;">alert("x:"+mouse_x+",y:"+mouse_y);<br>&nbsp;&nbsp;&nbsp;&nbsp;//$("#mx").val(mouse_x);<br>&nbsp;&nbsp;&nbsp;//&nbsp;$("#my").val(mouse_y);</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;ajax_id&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">'</span><span style="color: #000000;">ajax_</span><span style="color: #000000;">'</span><span style="color: #000000;">+</span><span style="color: #000000;">id;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span>if(ajax_div=document.getElementById(ajax_id)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ePoint = getAbsPoint(ajax_div);<br>&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; other_hiddenDiv(id); //ajax取消请求时，需隐藏要请求的内容 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp; }
<span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">//</span><span style="color: #008000;">此if语句表示鼠标在此元素范围以外，则隐藏某个层</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(mouseP</span><span style="color: #000000;">.</span><span style="color: #000000;">mouse_x&nbsp;</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">&nbsp;ePoint</span><span style="color: #000000;">.</span><span style="color: #000000;">l&nbsp;</span><span style="color: #000000;">||</span><span style="color: #000000;">&nbsp;mouseP</span><span style="color: #000000;">.</span><span style="color: #000000;">mouse_x&nbsp;</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">&nbsp;(ePoint</span><span style="color: #000000;">.</span><span style="color: #000000;">l&nbsp;</span><span style="color: #000000;">+</span><span style="color: #000000;">&nbsp;ePoint</span><span style="color: #000000;">.</span><span style="color: #000000;">w)&nbsp;</span><span style="color: #000000;">||</span><span style="color: #000000;">&nbsp;mouseP</span><span style="color: #000000;">.</span><span style="color: #000000;">mouse_y&nbsp;</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">&nbsp;ePoint</span><span style="color: #000000;">.</span><span style="color: #000000;">t&nbsp;</span><span style="color: #000000;">||</span><span style="color: #000000;">&nbsp;mouseP</span><span style="color: #000000;">.</span><span style="color: #000000;">mouse_y&nbsp;</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">&nbsp;(ePoint</span><span style="color: #000000;">.</span><span style="color: #000000;">t&nbsp;</span><span style="color: #000000;">+</span><span style="color: #000000;">&nbsp;ePoint</span><span style="color: #000000;">.</span><span style="color: #000000;">h))&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document</span><span style="color: #000000;">.</span><span style="color: #000000;">getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">ajax_</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id)</span><span style="color: #000000;">.</span><span style="color: #000000;">style</span><span style="color: #000000;">.</span><span style="color: #000000;">display&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">none</span><span style="color: #000000;">"</span><span style="color: #000000;">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br>}<br><br></span><span style="color: #0000ff;">function</span><span style="color: #000000;">&nbsp;other_hiddenDiv(id)&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document</span><span style="color: #000000;">.</span><span style="color: #000000;">getElementById(id)</span><span style="color: #000000;">.</span><span style="color: #000000;">style</span><span style="color: #000000;">.</span><span style="color: #000000;">display&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">none</span><span style="color: #000000;">"</span><span style="color: #000000;">;&nbsp;&nbsp;&nbsp;<br>}<br></span><span style="color: #0000ff;">function</span><span style="color: #000000;">&nbsp;showDiv(id)&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;document</span><span style="color: #000000;">.</span><span style="color: #000000;">getElementById(id)</span><span style="color: #000000;">.</span><span style="color: #000000;">style</span><span style="color: #000000;">.</span><span style="color: #000000;">display&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">""</span><span style="color: #000000;">;&nbsp;&nbsp;&nbsp;&nbsp;<br>}</span></div>
<br>2.HTML代码：<br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #0000ff;">&lt;</span><span style="color: #800000;"></span><span style="color: #ff0000;"></span><span style="color: #0000ff;">img </span><span style="color: #ff0000;">title</span><span style="color: #0000ff;">="{{$famous[i].emco_company}}"</span><span style="color: #ff0000;">&nbsp;onmouseover</span><span style="color: #0000ff;">="ajax_post('{{$famous[i].emco_member_id}}')"</span><span style="color: #ff0000;"> <br>onmouseout</span><span style="color: #0000ff;">="hiddenDiv('famous{{$famous[i].emco_member_id}}',event)"</span><span style="color: #0000ff;">&gt;鼠标经过这显示或隐藏生成的ajax层&lt;/img&gt;<br>&lt;div id="famous{{$famous[i].emco_member_id}}" style="margin_top:-20px;margin-left:50px;background-color:blue" width="100px"&gt;&lt;!--ajax层--&gt;<br>&nbsp;&nbsp;&nbsp; &lt;div name="loading{{$famous[i].emco_member_id}}" style="display:none;position:absolute;z-index:999;"&gt;Loading...&lt;/div&gt;<br>&nbsp;&nbsp;&nbsp; &lt;!--AJAX层将会在此处产生--&gt;<br>&lt;/div&gt;
<br></span></div>
<br>3.php后台：（生成ajax层
）<br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #0000ff;">function</span><span style="color: #000000;">&nbsp;actionACompanyPosts()&nbsp;{ <span style="color: #18a405;">//生成ajax层</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$posts</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #800080;">$this</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">_post</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">mACompanyPost();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">//</span><span style="color: #008000;">dump($posts);</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$posts_div</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">&lt;div&nbsp;id=ajax_famous</span><span style="color: #000000;">"</span><span style="color: #000000;">.</span><span style="color: #800080;">$_GET</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">member_id</span><span style="color: #000000;">'</span><span style="color: #000000;">]</span><span style="color: #000000;">.</span><span style="color: #000000;">"</span><span style="color: #000000;">&nbsp;width=300px&nbsp;style=\</span><span style="color: #000000;">"</span><span style="color: #000000;">position</span><span style="color: #000000;">:</span><span style="color: #000000;">absolute;z</span><span style="color: #000000;">-</span><span style="color: #000000;">index</span><span style="color: #000000;">:</span><span style="color: #000000;">999</span><span style="color: #000000;">;background</span><span style="color: #000000;">-</span><span style="color: #000000;">color</span><span style="color: #000000;">:</span><span style="color: #008000;">#</span><span style="color: #008000;">fff;border:1px&nbsp;solid&nbsp;black;margin-top:-30px\"&nbsp;onmouseout=\"hiddenDiv('famous".$_GET['member_id']."',event)\"&gt;";</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">!</span><span style="color: #0000ff;">empty</span><span style="color: #000000;">(</span><span style="color: #800080;">$posts</span><span style="color: #000000;">))&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$len</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #008080;">count</span><span style="color: #000000;">(</span><span style="color: #800080;">$posts</span><span style="color: #000000;">);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #800080;">$i</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">0</span><span style="color: #000000;">&nbsp;;&nbsp;</span><span style="color: #800080;">$i</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">&nbsp;</span><span style="color: #800080;">$len</span><span style="color: #000000;">&nbsp;;&nbsp;</span><span style="color: #800080;">$i</span><span style="color: #000000;">++</span><span style="color: #000000;">)&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$posts_div</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">.=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;"></span><span style="color: #008000;">($i+1).".&nbsp;".$posts[$i]['empo_name']."&lt;br/&gt;";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</span><span style="color: #0000ff;">else</span><span style="color: #000000;">&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$posts_div</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">.=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">暂无职位</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$posts_div</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">.=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">&lt;/div&gt;</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">echo</span><span style="color: #000000;">&nbsp;</span><span style="color: #800080;">$posts_div</span><span style="color: #000000;">;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;}</span></div>
<br><br><img src ="http://www.phpweblog.net/fuyongjie/aggbug/5653.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/fuyongjie/" target="_blank">bestmost</a> 2008-08-25 09:29 <a href="http://www.phpweblog.net/fuyongjie/archive/2008/08/25/5653.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>处理ajax 时应注意的问题</title><link>http://www.phpweblog.net/fuyongjie/archive/2008/08/23/5651.html</link><dc:creator>bestmost</dc:creator><author>bestmost</author><pubDate>Sat, 23 Aug 2008 09:42:00 GMT</pubDate><guid>http://www.phpweblog.net/fuyongjie/archive/2008/08/23/5651.html</guid><wfw:comment>http://www.phpweblog.net/fuyongjie/comments/5651.html</wfw:comment><comments>http://www.phpweblog.net/fuyongjie/archive/2008/08/23/5651.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/fuyongjie/comments/commentRss/5651.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/fuyongjie/services/trackbacks/5651.html</trackback:ping><description><![CDATA[1.动态生成的html元素id，反复对同一个元素进行异步提交防止生成多个相同的元素（此时他们的也id相同），可先做判断如：<br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000;">&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(document</span><span style="color: #000000;">.</span><span style="color: #000000;">getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">ajax_famous</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id))&nbsp;{</span><span style="color: #008000;">//</span><span style="color: #008000;">如果已经Ajax过了,就不再去Ajax</span><span style="color: #008000;"><br></span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showDiv(</span><span style="color: #000000;">"</span><span style="color: #000000;">ajax_famous</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id);<br>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</span><span style="color: #0000ff;">else</span><span style="color: #000000;">&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loading&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">div[@name=loading</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id</span><span style="color: #000000;">+</span><span style="color: #000000;">"</span><span style="color: #000000;">]</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$</span><span style="color: #000000;">.</span><span style="color: #000000;">ajax({<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">get</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">{{url&nbsp;c=Post&nbsp;a=ACompanyPosts}}</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">member_id=</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id</span><span style="color: #000000;">,</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beforeSend</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">function</span><span style="color: #000000;">(){$(loading)</span><span style="color: #000000;">.</span><span style="color: #000000;">show()}</span><span style="color: #000000;">,</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">function</span><span style="color: #000000;">(a){$(</span><span style="color: #000000;">"</span><span style="color: #000000;">#famous</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">id)</span><span style="color: #000000;">.</span><span style="color: #000000;">append(a)}</span><span style="color: #000000;">,</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complete</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">function</span><span style="color: #000000;">(){$(loading)</span><span style="color: #000000;">.</span><span style="color: #000000;">hide()}&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})<br>&nbsp;&nbsp;&nbsp;&nbsp;}</span></div>
2.判断一个元素是否已存在当前文档中用<br>&nbsp;&nbsp;&nbsp;&nbsp; if(<span style="color: red;">document.getElementById("ajax_famous"+id)）</span><br>&nbsp;而非<br>&nbsp;&nbsp;&nbsp; if($("#ajax_famous"+id)) // 即使不存在这个元素，jquery也不认为是false<br><br><img src ="http://www.phpweblog.net/fuyongjie/aggbug/5651.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/fuyongjie/" target="_blank">bestmost</a> 2008-08-23 17:42 <a href="http://www.phpweblog.net/fuyongjie/archive/2008/08/23/5651.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jQuery formValidator表单验证插件开源了!!含API帮助、源码、示例 </title><link>http://www.phpweblog.net/fuyongjie/archive/2008/08/07/5539.html</link><dc:creator>bestmost</dc:creator><author>bestmost</author><pubDate>Wed, 06 Aug 2008 16:04:00 GMT</pubDate><guid>http://www.phpweblog.net/fuyongjie/archive/2008/08/07/5539.html</guid><wfw:comment>http://www.phpweblog.net/fuyongjie/comments/5539.html</wfw:comment><comments>http://www.phpweblog.net/fuyongjie/archive/2008/08/07/5539.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/fuyongjie/comments/commentRss/5539.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/fuyongjie/services/trackbacks/5539.html</trackback:ping><description><![CDATA[<p><font style="FONT-SIZE: 24pt" face=Verdana><br>升级记录<br></font></p>
<p>bug描述:ajaxValidator函数在提交后发生错误，停留在本页面后,再次触发校验会让提示内容一直处于onload状态。<br></p>
<p>这个bug已经修复，请重新下载。 <br></p>
<p>&nbsp;</p>
<p>2008/7/17 14:12:00 jQuery formValidator 3.1ver</p>
<p><strong><br>1、为inputValidator增加empty属性。用于设置控件文本值是否允许两边为空。具体请看demo1里的密码的校验代码。<br></strong>该属性是个对象，默认值{leftempty:true,rightempty:true,emptyerror:null}<br>leftempty:表示左边是否允许为空<br>rightempty:表示右边是否允许为空 <br>emptyerror：出现该错误的时候的提示，如果为null，则利用onerror属性来提示错误。 <br><font color=#ff0000>注：只能在type:"size"的时候使用，即比较长度的时候。</font></p>
<p><strong>2、修</strong><strong>改自动构建提示层的语法。为formValidator函数增加relativeid属性。<br></strong>relativeid：表示提示层相对定位的控件ID，如果为空，则用当前校验控件的ID。<br>tipid：表示自动创建的提示层的ID，如果为空，则用当前校验控件的ID+"Tip"来命名。</p>
<p><strong>3、修正ajaxValidator函数里beforesend属性的bug。</strong>代码忘记传递它的唯一参数。</p>
<p><strong>4、修正ajaxValidator函数在后台无法获取中文的bug。</strong></p>
<p><strong>5、更新了升级记录、用户手册、增加了2个提问。</strong></p>
<p><font style="FONT-SIZE: 24pt" face=Verdana><font color=#ff0000><font face=Verdana><font style="COLOR: #000000" face=Verdana></font></font></font></font></p>
<font style="FONT-SIZE: 24pt" face=Verdana></font>
<p><font style="FONT-SIZE: 24pt" face=Verdana><br><span style="FONT-SIZE: 14pt"><strong>更多的升级记录，请点击</strong><a href="http://www.yhuan.com/formvalidator/update.html"><strong>这里<br></strong></a><br></span></font><br></p>
<p><span style="FONT-SIZE: 24pt"><span style="FONT-SIZE: 12pt">1、现场演示</span></span> <br></p>
<p><br></p>
<p><a href="http://www.yhuan.com/formvalidator/demo1.htm" target=_blank>http://www.yhuan.com/formvalidator/demo1.htm</a></p>
<p>&nbsp;</p>
<p>2、jQuery pageValidator插件主要功能 </p>
<p>&nbsp;</p>
<ol>
    <li>支持所有类型客户端控件的校验
    <li>支持jQuery所有的选择器语法，只要控件有唯一ID和type属性
    <li>支持函数和正则表达式的扩展。提供扩展库formValidatorReg.js，你可以自由的添加、修改里面的内容。
    <li>支持2种校验模式。第一种：文字提示(showword模式)；第二种：弹出窗口提示(showalert模式)
    <li>支持多个校验组。如果一个页面有多个提交按钮，分别做不同得提交，提交前要做不同的校验，所以你得用到校验组的功能。
    <li>支持4种状态的信息提示功能，可以灵活的控制4种状态是否显示。第一种：刚打开网页的时候进行提示；第二种：获得焦点的时候进行提示；第三种：失去焦点时，校验成功时候的提示；第四种：失去焦点时，校验失败的错误提示。
    <li>支持自动构建提示层。可以进行精确的定位。
    <li>支持自定义错误提示信息。
    <li>支持控件的字符长度、值范围、选择个数的控制。值范围支持数值型和字符型；选择的个数支持radio/checkbox/select三种控件
    <li>支持2个控件值的比较。目前可以比较字符串和数值型。
    <li>支持服务器端校验。
    <li>支持输入格式的校验。 <br></li>
</ol>
<p>&nbsp;</p>
<p><font color=#000000 size=6><strong style="FONT-SIZE: 10pt"><span style="FONT-SIZE: 24pt"><font color=#000000 size=6><strong>3、jQuery formValidator插件 API帮助文档<br></strong></font></span><br>帮助文档请点击<a href="http://www.yhuan.com/formvalidator/userguide.html#6">这里</a>&nbsp;<br><br><span style="FONT-SIZE: 24pt"><br>4、下载API帮助、源码、示例</span></strong></font><br><br><a title="jQuery formValidator插件" href="http://files.cnblogs.com/wzmaodong/formValidator3.1.rar"><font face=Verdana>http://files.cnblogs.com/wzmaodong/formValidator3.1.rar</font></a><br><br><a title="jQuery formValidator插件" href="http://files.cnblogs.com/wzmaodong/formValidator2.4.rar"><font face=Verdana>http://files.cnblogs.com/wzmaodong/formValidator2.4.rar</font></a><br><br><a title=校验代码升级器 href="http://www.yhuan.com/formvalidator/update.rar">校验代码升级器</a><br><span style="FONT-SIZE: 24pt"><strong><br><br>5、示例代码<br></strong></span><br><font face=Verdana>&lt;script type="text/javascript"&gt;<br>$(document).ready(function(){<br>&nbsp;$.formValidator.initConfig({onError:function(){alert("校验没有通过，具体错误请看错误提示")}});<br>&nbsp;$("#test1").formValidator({onshow:"请输入用户名",onfocus:"用户名至少6个字符,最多10个字符",oncorrect:"恭喜你,你输对了"}).InputValidator({min:6,max:10,onerror:"你输入的用户名非法,请确认"});<br><br>&nbsp;$("#test2").formValidator({onshow:"请选择你的兴趣爱好(至少选择3个,最多选择5个)",onfocus:"你至少选择3个,最多选择5个",oncorrect:"恭喜你,你选对了"}).InputValidator({min:3,max:5,onerror:"你选的个数不对(至少选择3个,最多选择5个)"});<br><br>&nbsp;$("#test3").formValidator({onshow:"请选择你的兴趣爱好（至少选一个）",onfocus:"你至少选择1个",oncorrect:"恭喜你,你选对了"}).InputValidator({min:1,onerror:"你选的个数不对"});<br><br>&nbsp;$("#xueli").formValidator({onshow:"请选择你的学历",onfocus:"学历必须选择",oncorrect:"谢谢你的配合"}).SelectValidator({onerror: "你是不是忘记选择学历了!"});<br><br>&nbsp;$("#password1").formValidator({onshow:"请输入密码",onfocus:"两次密码必须一致哦",oncorrect:"密码一致"}).InputValidator({min:1,onerror:"密码不能为空,请确认"}).CompareValidator({desID:"password2",operateor:"=",onerror:"2次密码不一致,请确认"});<br><br>&nbsp;$("#nl").formValidator({onshow:"请输入的年龄（1-99岁之间）",onfocus:"只能输入1-99之间的数字哦",oncorrect:"恭喜你,你输对了"}).InputValidator({min:1,max:99,type:"value",onerror:"年龄必须在1-99之间，请确认"});<br><br>&nbsp;$("#aiguo").formValidator({onshow:"爱国的人一定要选哦",onfocus:"你得认真思考哦",oncorrect:"不知道你爱不爱，反正你是选了"}).InputValidator({min:1,max:1,onerror:"难道你不爱国？你给我选！！！！"});<br><br>&nbsp;$("#shouji").formValidator({empty:true,onshow:"请输入你的手机号码，可以为空哦",onfocus:"你要是输入了，必须输入正确",oncorrect:"谢谢你的合作",onempty:"你真的不想留手机号码啊？"}).InputValidator({min:11,max:11,onerror:"手机号码必须是11位的,请确认"}).RegexValidator({regexp:"^[1][0-9]{10}$",onerror:"你输入的手机格式不正确"});<br><br>&nbsp;$("#lxdh").formValidator({empty:true,onshow:"请输入你的联系电话，可以为空哦",onfocus:"你要是输入了，必须输入正确，格式例如：0577-88069620",oncorrect:"谢谢你的合作",onempty:"你真的不想留联系电话了吗？"}).RegexValidator({regexp:"^[[0-9]{3}-|\[0-9]{4}-]?(\[0-9]{8}|[0-9]{7})?$",onerror:"你输入的联系电话格式不正确"});<br><br>&nbsp;$("#ms").formValidator({onshow:"请输入你的描述",onfocus:"描述至少要输入10个汉字或20个字符",oncorrect:"恭喜你,你输对了"}).InputValidator({min:20,onerror:"你输入的描述长度不正确,请确认"});<br>});<br>&lt;/script&gt;</font><br><br><br><strong style="FONT-SIZE: 24pt">6、特别说明</strong><br><br>如果你在使用过程中碰到什么问题请给我留言，发现bug请不要自行修改，也请留言，达到完善插件的目的，真正服务每个程序开发人员 .<br><strong style="FONT-SIZE: 14pt; COLOR: red">请保留插件的版权申明，谢谢</strong> </p>
<div id=EntryTag>Tag标签: <a href="http://www.cnblogs.com/wzmaodong/tag/formValidator/">formValidator</a>,<a href="http://www.cnblogs.com/wzmaodong/tag/%e6%8f%92%e4%bb%b6/">插件</a>,<a href="http://www.cnblogs.com/wzmaodong/tag/%e8%a1%a8%e5%8d%95/">表单</a>,<a href="http://www.cnblogs.com/wzmaodong/tag/%e9%aa%8c%e8%af%81/">验证</a>,<a href="http://www.cnblogs.com/wzmaodong/tag/%e6%8f%92%e4%bb%b6/">插件</a>,<a href="http://www.cnblogs.com/wzmaodong/tag/javascript/">javascript</a>,<a href="http://www.cnblogs.com/wzmaodong/tag/%e8%a1%a8%e5%8d%95%e9%aa%8c%e8%af%81/">表单验证</a>,<a href="http://www.cnblogs.com/wzmaodong/tag/jQuery/">jQuery</a>,<a href="http://www.cnblogs.com/wzmaodong/tag/%e6%8f%90%e7%a4%ba%e5%b1%82/">提示层</a></div><img src ="http://www.phpweblog.net/fuyongjie/aggbug/5539.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/fuyongjie/" target="_blank">bestmost</a> 2008-08-07 00:04 <a href="http://www.phpweblog.net/fuyongjie/archive/2008/08/07/5539.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>（转）ajax+jquery+flea下拉列表动态显示相应的数据</title><link>http://www.phpweblog.net/fuyongjie/archive/2008/07/26/5480.html</link><dc:creator>bestmost</dc:creator><author>bestmost</author><pubDate>Sat, 26 Jul 2008 06:57:00 GMT</pubDate><guid>http://www.phpweblog.net/fuyongjie/archive/2008/07/26/5480.html</guid><wfw:comment>http://www.phpweblog.net/fuyongjie/comments/5480.html</wfw:comment><comments>http://www.phpweblog.net/fuyongjie/archive/2008/07/26/5480.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/fuyongjie/comments/commentRss/5480.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/fuyongjie/services/trackbacks/5480.html</trackback:ping><description><![CDATA[<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000;">这只是一些实现代码的片段,仅供参考[来源Fleaphp]<br><br></span><span style="color: #0000ff;">function</span><span style="color: #000000;">&nbsp;selectDisplay()&nbsp;&nbsp;用来读取通过改变下拉列表要显示的数据&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$model</span><span style="color: #000000;">=&amp;</span><span style="color: #000000;">FLEA::getSingleton(&#8216;Table_modelInfo&#8217;);</span><span style="color: #008000;">//</span><span style="color: #008000;">引入要用到的数据表类&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$condition</span><span style="color: #000000;">=</span><span style="color: #000000;">array(&#8216;RegID&#8217;</span><span style="color: #000000;">=&gt;</span><span style="color: #000000;">5</span><span style="color: #000000;">);</span><span style="color: #008000;">//</span><span style="color: #008000;">显示的条件&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$rows</span><span style="color: #000000;">=</span><span style="color: #000000;">$model</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">find($condition);</span><span style="color: #008000;">//</span><span style="color: #008000;">查询数据&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;($rows&nbsp;as&nbsp;$item)&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;$item.&#8216;</span><span style="color: #000000;">|</span><span style="color: #000000;">&#8217;;&nbsp;&nbsp;打印出查找出来的数据并以&#8220;</span><span style="color: #000000;">|</span><span style="color: #000000;">&#8221;为分隔符来分隔数据用于读取&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;<br><br>http:</span><span style="color: #008000;">//</span><span style="color: #008000;">localhost/index.php/Default/SelectDisplay&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br></span><span style="color: #0000ff;">function</span><span style="color: #000000;">&nbsp;actionDisplay()&nbsp;&nbsp;<br><br>{&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$</span><span style="color: #0000ff;">this</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">selectDisplay();</span><span style="color: #008000;">//</span><span style="color: #008000;">调用执行selectDisplay()&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br>}&nbsp;&nbsp;<br><br>&nbsp;&nbsp;<br><br>test.html&nbsp;&nbsp;<br><br></span><span style="color: #000000;">&lt;</span><span style="color: #000000;">script&nbsp;lanuage</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;">javascript</span><span style="color: #000000;">"</span><span style="color: #000000;">&nbsp;src</span><span style="color: #000000;">=</span><span style="color: #000000;">js</span><span style="color: #000000;">/</span><span style="color: #000000;">jquery.js</span><span style="color: #000000;">&gt;&lt;/</span><span style="color: #000000;">script</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">&nbsp;&nbsp;<br><br></span><span style="color: #000000;">&lt;</span><span style="color: #000000;">script&nbsp;lanuage</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;">javascript</span><span style="color: #000000;">"</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">&nbsp;&nbsp;<br><br>$().ready(</span><span style="color: #0000ff;">function</span><span style="color: #000000;">(){&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">//</span><span style="color: #008000;">mould下拉列表的ID&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&#8216;#mould&#8217;).change(</span><span style="color: #0000ff;">function</span><span style="color: #000000;">(){&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.ajax({&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type:</span><span style="color: #000000;">"</span><span style="color: #000000;">GET</span><span style="color: #000000;">"</span><span style="color: #000000;">,&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data:</span><span style="color: #000000;">"</span><span style="color: #000000;">modelID=</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">$(</span><span style="color: #000000;">"</span><span style="color: #000000;">#mould</span><span style="color: #000000;">"</span><span style="color: #000000;">).val(),</span><span style="color: #008000;">//</span><span style="color: #008000;">获取下拉列表的值&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url:</span><span style="color: #000000;">"</span><span style="color: #000000;">../../index.php/Default/SelectDisplay</span><span style="color: #000000;">"</span><span style="color: #000000;">,&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success:change,</span><span style="color: #008000;">//</span><span style="color: #008000;">执行javasctip函数change()&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;});&nbsp;&nbsp;<br><br>})&nbsp;&nbsp;<br><br>&nbsp;&nbsp;<br><br></span><span style="color: #0000ff;">function</span><span style="color: #000000;">&nbsp;change(value)&nbsp;&nbsp;<br><br>{&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">var</span><span style="color: #000000;">&nbsp;result</span><span style="color: #000000;">=</span><span style="color: #000000;">value;&nbsp;&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;data</span><span style="color: #000000;">=</span><span style="color: #000000;">result.split(</span><span style="color: #000000;">"</span><span style="color: #000000;">|</span><span style="color: #000000;">"</span><span style="color: #000000;">);</span><span style="color: #008000;">//</span><span style="color: #008000;">获取url指的页面打印出来的值，用split("|")以数组形式读取出来的&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br></span><span style="color: #008000;">//</span><span style="color: #008000;">赋值中主要是单选框、复选框赋值有所不同&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;$(</span><span style="color: #000000;">"</span><span style="color: #000000;">#p_title</span><span style="color: #000000;">"</span><span style="color: #000000;">).val(data[</span><span style="color: #000000;">2</span><span style="color: #000000;">]);&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;$(</span><span style="color: #000000;">"</span><span style="color: #000000;">input[@name=p_KIND]</span><span style="color: #000000;">"</span><span style="color: #000000;">).get(data[</span><span style="color: #000000;">0</span><span style="color: #000000;">]).checked</span><span style="color: #000000;">=</span><span style="color: #0000ff;">true</span><span style="color: #000000;">;</span><span style="color: #008000;">//</span><span style="color: #008000;">对单选框赋值&nbsp;&nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;$(</span><span style="color: #000000;">"</span><span style="color: #000000;">#p_NUM</span><span style="color: #000000;">"</span><span style="color: #000000;">).val(data[</span><span style="color: #000000;">1</span><span style="color: #000000;">]);&nbsp;&nbsp;<br><br>其他赋值都一样了&nbsp;&nbsp;<br><br>&nbsp;&nbsp;<br><br>}&nbsp;&nbsp;<br><br>&nbsp;&nbsp;<br><br></span><span style="color: #000000;">&lt;/</span><span style="color: #000000;">script</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">&nbsp;&nbsp;<br><br>&nbsp;</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">select&nbsp;name</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;">mould</span><span style="color: #000000;">"</span><span style="color: #000000;">&nbsp;id</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;">mould</span><span style="color: #000000;">"</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">&nbsp;&nbsp;<br><br>&nbsp;{{html_options&nbsp;options</span><span style="color: #000000;">=</span><span style="color: #000000;">$rows}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用smarty模板里html_options填充的数据&nbsp;&nbsp;<br><br>&nbsp;&nbsp;</span><span style="color: #000000;">&lt;/</span><span style="color: #000000;">select</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">&nbsp;&nbsp;</span></div>
<br><img src ="http://www.phpweblog.net/fuyongjie/aggbug/5480.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/fuyongjie/" target="_blank">bestmost</a> 2008-07-26 14:57 <a href="http://www.phpweblog.net/fuyongjie/archive/2008/07/26/5480.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>AJAX中同时发送多个请求XMLHttpRequest对象处理方法</title><link>http://www.phpweblog.net/fuyongjie/archive/2008/05/21/3657.html</link><dc:creator>bestmost</dc:creator><author>bestmost</author><pubDate>Wed, 21 May 2008 08:06:00 GMT</pubDate><guid>http://www.phpweblog.net/fuyongjie/archive/2008/05/21/3657.html</guid><wfw:comment>http://www.phpweblog.net/fuyongjie/comments/3657.html</wfw:comment><comments>http://www.phpweblog.net/fuyongjie/archive/2008/05/21/3657.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.phpweblog.net/fuyongjie/comments/commentRss/3657.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/fuyongjie/services/trackbacks/3657.html</trackback:ping><description><![CDATA[<p>在ajax应用中，通常一个页面要同时发送多个请求，如果只有一个XMLHttpRequest对象，前面的请求还未完成，后面的就会把前面的覆盖 掉，如果每次都创建一个新的XMLHttpRequest对象，也会造成浪费。解决的办法就是创建一个XMLHttpRequset的对象池，如果池里有 空闲的对象，则使用此对象，否则将创建一个新的对象。</p>
<p>下面是我最近写的一个简单的类：<br><font color=#ff8000>*&nbsp;XMLHttpRequest&nbsp;Object&nbsp;Pool<br>&nbsp;*<br>&nbsp;*&nbsp;@author&nbsp;&nbsp;&nbsp;&nbsp;legend&nbsp;&lt;legendsky@hotmail.com&gt;<br>&nbsp;*&nbsp;@link&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://www.ugia.cn/?p=85<br>&nbsp;*&nbsp;@Copyright&nbsp;www.ugia.cn<br>&nbsp;*/&nbsp;<br></font><span class=php_007700><font color=#007700>var&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>XMLHttp&nbsp;</font></span><span class=php_007700><font color=#007700>=&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>_objPool</font></span><span class=php_007700><font color=#007700>:&nbsp;[],<br>&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>_getInstance</font></span><span class=php_007700><font color=#007700>:&nbsp;function&nbsp;()<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>i&nbsp;</font></span><span class=php_007700><font color=#007700>=&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>0</font></span><span class=php_007700><font color=#007700>;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>i&nbsp;</font></span><span class=php_007700><font color=#007700>&lt;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>this</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>_objPool</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>length</font></span><span class=php_007700><font color=#007700>;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>i&nbsp;</font></span><span class=php_007700><font color=#007700>++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</font></span><span class=php_0000BB><font color=#0000bb>this</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>_objPool</font></span><span class=php_007700><font color=#007700>[</font></span><span class=php_0000BB><font color=#0000bb>i</font></span><span class=php_007700><font color=#007700>].</font></span><span class=php_0000BB><font color=#0000bb>readyState&nbsp;</font></span><span class=php_007700><font color=#007700>==&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>0&nbsp;</font></span><span class=php_007700><font color=#007700>||&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>this</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>_objPool</font></span><span class=php_007700><font color=#007700>[</font></span><span class=php_0000BB><font color=#0000bb>i</font></span><span class=php_007700><font color=#007700>].</font></span><span class=php_0000BB><font color=#0000bb>readyState&nbsp;</font></span><span class=php_007700><font color=#007700>==&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>4</font></span><span class=php_007700><font color=#007700>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>this</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>_objPool</font></span><span class=php_007700><font color=#007700>[</font></span><span class=php_0000BB><font color=#0000bb>i</font></span><span class=php_007700><font color=#007700>];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_FF8000><font color=#ff8000>//&nbsp;IE5中不支持push方法<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>this</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>_objPool</font></span><span class=php_007700><font color=#007700>[</font></span><span class=php_0000BB><font color=#0000bb>this</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>_objPool</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>length</font></span><span class=php_007700><font color=#007700>]&nbsp;=&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>this</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>_createObj</font></span><span class=php_007700><font color=#007700>();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>this</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>_objPool</font></span><span class=php_007700><font color=#007700>[</font></span><span class=php_0000BB><font color=#0000bb>this</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>_objPool</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>length&nbsp;</font></span><span class=php_007700><font color=#007700>-&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>1</font></span><span class=php_007700><font color=#007700>];<br>&nbsp;&nbsp;&nbsp;&nbsp;},<br>&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>_createObj</font></span><span class=php_007700><font color=#007700>:&nbsp;function&nbsp;()<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</font></span><span class=php_0000BB><font color=#0000bb>window</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>XMLHttpRequest</font></span><span class=php_007700><font color=#007700>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp&nbsp;</font></span><span class=php_007700><font color=#007700>=&nbsp;new&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>XMLHttpRequest</font></span><span class=php_007700><font color=#007700>();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>MSXML&nbsp;</font></span><span class=php_007700><font color=#007700>=&nbsp;[</font></span><span class=php_DD0000><font color=#dd0000>'MSXML2.XMLHTTP.5.0'</font></span><span class=php_007700><font color=#007700>,&nbsp;</font></span><span class=php_DD0000><font color=#dd0000>'MSXML2.XMLHTTP.4.0'</font></span><span class=php_007700><font color=#007700>,&nbsp;</font></span><span class=php_DD0000><font color=#dd0000>'MSXML2.XMLHTTP.3.0'</font></span><span class=php_007700><font color=#007700>,&nbsp;</font></span><span class=php_DD0000><font color=#dd0000>'MSXML2.XMLHTTP'</font></span><span class=php_007700><font color=#007700>,&nbsp;</font></span><span class=php_DD0000><font color=#dd0000>'Microsoft.XMLHTTP'</font></span><span class=php_007700><font color=#007700>];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(var&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>n&nbsp;</font></span><span class=php_007700><font color=#007700>=&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>0</font></span><span class=php_007700><font color=#007700>;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>n&nbsp;</font></span><span class=php_007700><font color=#007700>&lt;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>MSXML</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>length</font></span><span class=php_007700><font color=#007700>;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>n&nbsp;</font></span><span class=php_007700><font color=#007700>++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>try<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_007700><font color=#007700>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp&nbsp;</font></span><span class=php_007700><font color=#007700>=&nbsp;new&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>ActiveXObject</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_0000BB><font color=#0000bb>MSXML</font></span><span class=php_007700><font color=#007700>[</font></span><span class=php_0000BB><font color=#0000bb>n</font></span><span class=php_007700><font color=#007700>]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>catch</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_0000BB><font color=#0000bb>e</font></span><span class=php_007700><font color=#007700>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_FF8000><font color=#ff8000>//&nbsp;mozilla某些版本没有readyState属性<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_007700><font color=#007700>if&nbsp;(</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>readyState&nbsp;</font></span><span class=php_007700><font color=#007700>==&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>null</font></span><span class=php_007700><font color=#007700>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>readyState&nbsp;</font></span><span class=php_007700><font color=#007700>=&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>0</font></span><span class=php_007700><font color=#007700>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>addEventListener</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_DD0000><font color=#dd0000>"load"</font></span><span class=php_007700><font color=#007700>,&nbsp;function&nbsp;()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>readyState&nbsp;</font></span><span class=php_007700><font color=#007700>=&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>4</font></span><span class=php_007700><font color=#007700>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</font></span><span class=php_0000BB><font color=#0000bb>typeof&nbsp;objXMLHttp</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>onreadystatechange&nbsp;</font></span><span class=php_007700><font color=#007700>==&nbsp;</font></span><span class=php_DD0000><font color=#dd0000>"function"</font></span><span class=php_007700><font color=#007700>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>onreadystatechange</font></span><span class=php_007700><font color=#007700>();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>false</font></span><span class=php_007700><font color=#007700>);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>;<br>&nbsp;&nbsp;&nbsp;&nbsp;},<br>&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_FF8000><font color=#ff8000>//&nbsp;发送请求(方法[post,get],&nbsp;地址,&nbsp;数据,&nbsp;回调函数)<br>&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>sendReq</font></span><span class=php_007700><font color=#007700>:&nbsp;function&nbsp;(</font></span><span class=php_0000BB><font color=#0000bb>method</font></span><span class=php_007700><font color=#007700>,&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>url</font></span><span class=php_007700><font color=#007700>,&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>data</font></span><span class=php_007700><font color=#007700>,&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>callback</font></span><span class=php_007700><font color=#007700>)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp&nbsp;</font></span><span class=php_007700><font color=#007700>=&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>this</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>_getInstance</font></span><span class=php_007700><font color=#007700>();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>with</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>try<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_007700><font color=#007700>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_FF8000><font color=#ff8000>//&nbsp;加随机数防止缓存<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_007700><font color=#007700>if&nbsp;(</font></span><span class=php_0000BB><font color=#0000bb>url</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>indexOf</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_DD0000><font color=#dd0000>"?"</font></span><span class=php_007700><font color=#007700>)&nbsp;&gt;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>0</font></span><span class=php_007700><font color=#007700>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>url&nbsp;</font></span><span class=php_007700><font color=#007700>+=&nbsp;</font></span><span class=php_DD0000><font color=#dd0000>"&amp;randnum="&nbsp;</font></span><span class=php_007700><font color=#007700>+&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>Math</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>random</font></span><span class=php_007700><font color=#007700>();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>url&nbsp;</font></span><span class=php_007700><font color=#007700>+=&nbsp;</font></span><span class=php_DD0000><font color=#dd0000>"?randnum="&nbsp;</font></span><span class=php_007700><font color=#007700>+&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>Math</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>random</font></span><span class=php_007700><font color=#007700>();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>open</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_0000BB><font color=#0000bb>method</font></span><span class=php_007700><font color=#007700>,&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>url</font></span><span class=php_007700><font color=#007700>,&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>true</font></span><span class=php_007700><font color=#007700>);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_FF8000><font color=#ff8000>//&nbsp;设定请求编码方式<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>setRequestHeader</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_DD0000><font color=#dd0000>'Content-Type'</font></span><span class=php_007700><font color=#007700>,&nbsp;</font></span><span class=php_DD0000><font color=#dd0000>'application/x-www-form-urlencoded;&nbsp;charset=UTF-8'</font></span><span class=php_007700><font color=#007700>);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>send</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_0000BB><font color=#0000bb>data</font></span><span class=php_007700><font color=#007700>);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>onreadystatechange&nbsp;</font></span><span class=php_007700><font color=#007700>=&nbsp;function&nbsp;()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>readyState&nbsp;</font></span><span class=php_007700><font color=#007700>==&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>4&nbsp;</font></span><span class=php_007700><font color=#007700>&amp;&amp;&nbsp;(</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>status&nbsp;</font></span><span class=php_007700><font color=#007700>==&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>200&nbsp;</font></span><span class=php_007700><font color=#007700>||&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>.</font></span><span class=php_0000BB><font color=#0000bb>status&nbsp;</font></span><span class=php_007700><font color=#007700>==&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>304</font></span><span class=php_007700><font color=#007700>))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>callback</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_0000BB><font color=#0000bb>objXMLHttp</font></span><span class=php_007700><font color=#007700>);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>catch</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_0000BB><font color=#0000bb>e</font></span><span class=php_007700><font color=#007700>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>alert</font></span><span class=php_007700><font color=#007700>(</font></span><span class=php_0000BB><font color=#0000bb>e</font></span><span class=php_007700><font color=#007700>);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>};&nbsp; </font><br></span></p>
<p>示例： </p>
<div class=php_code><span class=php_000000><span class=php_0000BB></span><span class=php_007700><font color=#007700>&lt;</font></span><span class=php_0000BB><font color=#0000bb>script&nbsp;type</font></span><span class=php_007700><font color=#007700>=</font></span><span class=php_DD0000><font color=#dd0000>"text/javascript"&nbsp;</font></span><span class=php_0000BB><font color=#0000bb>src</font></span><span class=php_007700><font color=#007700>=</font></span><span class=php_DD0000><font color=#dd0000>"xmlhttp.js"</font></span><span class=php_007700><font color=#007700>&gt;</font></span><span class=php_0000BB><font color=#0000bb>&lt;/script&gt;<br></font></span>&lt;script&nbsp;type="text/javascript"&gt;<br>function&nbsp;test(obj)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;alert(obj.statusText);<br>}<br>XMLHttp.sendReq('GET',&nbsp;'http://www.ugia.cn/wp-data/test.htm',&nbsp;'',&nbsp;test);<br>XMLHttp.sendReq('GET',&nbsp;'http://www.ugia.cn/wp-data/test.htm',&nbsp;'',&nbsp;test);<br>XMLHttp.sendReq('GET',&nbsp;'http://www.ugia.cn/wp-data/test.htm',&nbsp;'',&nbsp;test);<br>XMLHttp.sendReq('GET',&nbsp;'http://www.ugia.cn/wp-data/test.htm',&nbsp;'',&nbsp;test);<br>alert('Pool&nbsp;length:'&nbsp;+&nbsp;XMLHttp._objPool.length);<br>&lt;/script&gt;&nbsp; <br><br><a href="http://blog.csdn.net/lee576/archive/2008/01/07/2029445.aspx">http://blog.csdn.net/lee576/archive/2008/01/07/2029445.aspx</a><br></span></div>
<img src ="http://www.phpweblog.net/fuyongjie/aggbug/3657.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/fuyongjie/" target="_blank">bestmost</a> 2008-05-21 16:06 <a href="http://www.phpweblog.net/fuyongjie/archive/2008/05/21/3657.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ajax 同一页面同时执行多个 XMLHTTP</title><link>http://www.phpweblog.net/fuyongjie/archive/2008/05/21/3654.html</link><dc:creator>bestmost</dc:creator><author>bestmost</author><pubDate>Wed, 21 May 2008 08:03:00 GMT</pubDate><guid>http://www.phpweblog.net/fuyongjie/archive/2008/05/21/3654.html</guid><wfw:comment>http://www.phpweblog.net/fuyongjie/comments/3654.html</wfw:comment><comments>http://www.phpweblog.net/fuyongjie/archive/2008/05/21/3654.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.phpweblog.net/fuyongjie/comments/commentRss/3654.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/fuyongjie/services/trackbacks/3654.html</trackback:ping><description><![CDATA[<p style="FONT-SIZE: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ajax 同一页面如何同时执行多个 XMLHTTP 呢，比如博客页，需要同时利用 Ajax 读取作者信息、文章信息、评论信息&#8230;&#8230;</p>
<p style="FONT-SIZE: 14pt">我们的第一反应可能是创建多个全局 XMLHTTP 对象，但这并不现实。其实实现方式非常简单，就是给 onreadystatechange 对应的回调函数加上参数，以下代码是解决方案中一个函数中的一段代码。</p>
<p style="FONT-SIZE: 14pt"></p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">xmlhttp.open(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">GET</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ajax_process.aspx?a=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;a,&nbsp;</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">);<br><img id=Codehighlighter1_96_128_Open_Image onclick="this.style.display='none'; Codehighlighter1_96_128_Open_Text.style.display='none'; Codehighlighter1_96_128_Closed_Image.style.display='inline'; Codehighlighter1_96_128_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_96_128_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_96_128_Closed_Text.style.display='none'; Codehighlighter1_96_128_Open_Image.style.display='inline'; Codehighlighter1_96_128_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top>xmlhttp.onreadystatechange&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">&nbsp;()&nbsp;</span><span id=Codehighlighter1_96_128_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_96_128_Open_Text><span style="COLOR: #000000">{&nbsp;OnReadyStateChng(xmlhttp,&nbsp;a);&nbsp;}</span></span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>xmlhttp.send(</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></div>
<p style="FONT-SIZE: 14pt">只是改写 onreadystatechange&nbsp;的属性值，这样就可以为 OnReadyStateChng 函数赋参数了。如是我们写作 xmlhttp.onreadystatechange = OnReadyStateChng;，那么 OnReadyStateChng 就不能有参数了，也就无法获得是哪个 xmlhttp 的响应，也就无法获得是响应后要对哪个控件进行设置。</p>
<p style="FONT-SIZE: 14pt">我们可以看一个完整的示例，前台页面是普通的 Ajax 技术的 HTML 页面，后台使用的是 <a href="http://www.cftea.com/docs/" target=_blank>ASP.NET</a> 的 .aspx 文件，之所以采用 ASP.NET，是为了演示延时处理功能。</p>
<p style="FONT-SIZE: 14pt">前台程序</p>
<div style="FONT-SIZE: 14pt"><br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">&lt;!</span><span style="COLOR: #ff00ff">DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;"-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Transitional//EN"&nbsp;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">html&nbsp;</span><span style="COLOR: #ff0000">xmlns</span><span style="COLOR: #0000ff">="http://www.w3.org/1999/xhtml"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">meta&nbsp;</span><span style="COLOR: #ff0000">http-equiv</span><span style="COLOR: #0000ff">="Content-Type"</span><span style="COLOR: #ff0000">&nbsp;content</span><span style="COLOR: #0000ff">="text/html;&nbsp;charset=utf8"</span><span style="COLOR: #ff0000">&nbsp;</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">Ajax&nbsp;Test</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img id=Codehighlighter1_321_1999_Open_Image onclick="this.style.display='none'; Codehighlighter1_321_1999_Open_Text.style.display='none'; Codehighlighter1_321_1999_Closed_Image.style.display='inline'; Codehighlighter1_321_1999_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_321_1999_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_321_1999_Closed_Text.style.display='none'; Codehighlighter1_321_1999_Open_Image.style.display='inline'; Codehighlighter1_321_1999_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">script&nbsp;</span><span style="COLOR: #ff0000">type</span><span style="COLOR: #0000ff">="text/javascript"</span><span style="COLOR: #ff0000">&nbsp;language</span><span style="COLOR: #0000ff">="javascript"</span><span style="COLOR: #0000ff">&gt;</span><span id=Codehighlighter1_321_1999_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_321_1999_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;!--</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">&nbsp;1.创建XMLHttpRequest对象</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;CreateHTTPObject()<br><img id=Codehighlighter1_381_1108_Open_Image onclick="this.style.display='none'; Codehighlighter1_381_1108_Open_Text.style.display='none'; Codehighlighter1_381_1108_Closed_Image.style.display='inline'; Codehighlighter1_381_1108_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_381_1108_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_381_1108_Closed_Text.style.display='none'; Codehighlighter1_381_1108_Open_Image.style.display='inline'; Codehighlighter1_381_1108_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_381_1108_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_381_1108_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;xmlhttp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">try</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img id=Codehighlighter1_417_478_Open_Image onclick="this.style.display='none'; Codehighlighter1_417_478_Open_Text.style.display='none'; Codehighlighter1_417_478_Closed_Image.style.display='inline'; Codehighlighter1_417_478_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_417_478_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_417_478_Closed_Text.style.display='none'; Codehighlighter1_417_478_Open_Image.style.display='inline'; Codehighlighter1_417_478_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_417_478_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_417_478_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">new</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;ActiveXObject(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Msxml2.XMLHTTP</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">catch</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;(e)<br><img id=Codehighlighter1_498_665_Open_Image onclick="this.style.display='none'; Codehighlighter1_498_665_Open_Text.style.display='none'; Codehighlighter1_498_665_Closed_Image.style.display='inline'; Codehighlighter1_498_665_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_498_665_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_498_665_Closed_Text.style.display='none'; Codehighlighter1_498_665_Open_Image.style.display='inline'; Codehighlighter1_498_665_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_498_665_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_498_665_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">try</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img id=Codehighlighter1_520_592_Open_Image onclick="this.style.display='none'; Codehighlighter1_520_592_Open_Text.style.display='none'; Codehighlighter1_520_592_Closed_Image.style.display='inline'; Codehighlighter1_520_592_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_520_592_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_520_592_Closed_Text.style.display='none'; Codehighlighter1_520_592_Open_Image.style.display='inline'; Codehighlighter1_520_592_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_520_592_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_520_592_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">new</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;ActiveXObject(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Microsoft.XMLHTTP</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">catch</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;(e)<br><img id=Codehighlighter1_620_659_Open_Image onclick="this.style.display='none'; Codehighlighter1_620_659_Open_Text.style.display='none'; Codehighlighter1_620_659_Closed_Image.style.display='inline'; Codehighlighter1_620_659_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_620_659_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_620_659_Closed_Text.style.display='none'; Codehighlighter1_620_659_Open_Image.style.display='inline'; Codehighlighter1_620_659_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_620_659_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_620_659_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">false</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">!</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">xmlhttp&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;&amp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">typeof</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;XMLHttpRequest</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">!=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">'undefined')<br><img id=Codehighlighter1_732_879_Open_Image onclick="this.style.display='none'; Codehighlighter1_732_879_Open_Text.style.display='none'; Codehighlighter1_732_879_Closed_Image.style.display='inline'; Codehighlighter1_732_879_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_732_879_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_732_879_Closed_Text.style.display='none'; Codehighlighter1_732_879_Open_Image.style.display='inline'; Codehighlighter1_732_879_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_732_879_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_732_879_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">try</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img id=Codehighlighter1_754_808_Open_Image onclick="this.style.display='none'; Codehighlighter1_754_808_Open_Text.style.display='none'; Codehighlighter1_754_808_Closed_Image.style.display='inline'; Codehighlighter1_754_808_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_754_808_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_754_808_Closed_Text.style.display='none'; Codehighlighter1_754_808_Open_Image.style.display='inline'; Codehighlighter1_754_808_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_754_808_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_754_808_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">new</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;XMLHttpRequest();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">catch</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;(e)<br><img id=Codehighlighter1_836_873_Open_Image onclick="this.style.display='none'; Codehighlighter1_836_873_Open_Text.style.display='none'; Codehighlighter1_836_873_Closed_Image.style.display='inline'; Codehighlighter1_836_873_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_836_873_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_836_873_Closed_Text.style.display='none'; Codehighlighter1_836_873_Open_Image.style.display='inline'; Codehighlighter1_836_873_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_836_873_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_836_873_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">false</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">!</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">xmlhttp&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;&amp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;window.createRequest)<br><img id=Codehighlighter1_932_1081_Open_Image onclick="this.style.display='none'; Codehighlighter1_932_1081_Open_Text.style.display='none'; Codehighlighter1_932_1081_Closed_Image.style.display='inline'; Codehighlighter1_932_1081_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_932_1081_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_932_1081_Closed_Text.style.display='none'; Codehighlighter1_932_1081_Open_Image.style.display='inline'; Codehighlighter1_932_1081_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_932_1081_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_932_1081_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">try</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img id=Codehighlighter1_954_1010_Open_Image onclick="this.style.display='none'; Codehighlighter1_954_1010_Open_Text.style.display='none'; Codehighlighter1_954_1010_Closed_Image.style.display='inline'; Codehighlighter1_954_1010_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_954_1010_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_954_1010_Closed_Text.style.display='none'; Codehighlighter1_954_1010_Open_Image.style.display='inline'; Codehighlighter1_954_1010_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_954_1010_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_954_1010_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;window.createRequest();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">catch</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;(e)<br><img id=Codehighlighter1_1038_1075_Open_Image onclick="this.style.display='none'; Codehighlighter1_1038_1075_Open_Text.style.display='none'; Codehighlighter1_1038_1075_Closed_Image.style.display='inline'; Codehighlighter1_1038_1075_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1038_1075_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1038_1075_Closed_Text.style.display='none'; Codehighlighter1_1038_1075_Open_Image.style.display='inline'; Codehighlighter1_1038_1075_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_1038_1075_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1038_1075_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">false</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">return</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;xmlhttp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">&nbsp;2.浏览器&nbsp;-&gt;&nbsp;服务器&nbsp;&nbsp;(提交请求信息)</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;SubmitMsg(a)<br><img id=Codehighlighter1_1163_1489_Open_Image onclick="this.style.display='none'; Codehighlighter1_1163_1489_Open_Text.style.display='none'; Codehighlighter1_1163_1489_Closed_Image.style.display='inline'; Codehighlighter1_1163_1489_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1163_1489_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1163_1489_Closed_Text.style.display='none'; Codehighlighter1_1163_1489_Open_Image.style.display='inline'; Codehighlighter1_1163_1489_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_1163_1489_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1163_1489_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;xmlhttp&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;CreateHTTPObject();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">alert(xmlhttp);</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">!</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">xmlhttp)<br><img id=Codehighlighter1_1244_1284_Open_Image onclick="this.style.display='none'; Codehighlighter1_1244_1284_Open_Text.style.display='none'; Codehighlighter1_1244_1284_Closed_Image.style.display='inline'; Codehighlighter1_1244_1284_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1244_1284_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1244_1284_Closed_Text.style.display='none'; Codehighlighter1_1244_1284_Open_Image.style.display='inline'; Codehighlighter1_1244_1284_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_1244_1284_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1244_1284_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">return</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;&nbsp;</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">无法创建&nbsp;xmlhttp&nbsp;对象</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">Ajax&nbsp;提交</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp.open(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">GET</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">,&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><span style="COLOR: #000000">ajax_process.aspx?a=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;a,&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">true</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<br><img id=Codehighlighter1_1430_1462_Open_Image onclick="this.style.display='none'; Codehighlighter1_1430_1462_Open_Text.style.display='none'; Codehighlighter1_1430_1462_Closed_Image.style.display='inline'; Codehighlighter1_1430_1462_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1430_1462_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1430_1462_Closed_Text.style.display='none'; Codehighlighter1_1430_1462_Open_Image.style.display='inline'; Codehighlighter1_1430_1462_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp.onreadystatechange&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;()&nbsp;</span><span id=Codehighlighter1_1430_1462_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1430_1462_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{&nbsp;OnReadyStateChng(xmlhttp,&nbsp;a);&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;xmlhttp.send(</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">null</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">&nbsp;3.服务器&nbsp;-&gt;&nbsp;浏览器&nbsp;&nbsp;(正确时返回数据)</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;OnReadyStateChng(xmlhttp,&nbsp;a)<br><img id=Codehighlighter1_1563_1917_Open_Image onclick="this.style.display='none'; Codehighlighter1_1563_1917_Open_Text.style.display='none'; Codehighlighter1_1563_1917_Closed_Image.style.display='inline'; Codehighlighter1_1563_1917_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1563_1917_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1563_1917_Closed_Text.style.display='none'; Codehighlighter1_1563_1917_Open_Image.style.display='inline'; Codehighlighter1_1563_1917_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_1563_1917_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1563_1917_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;(xmlhttp.readyState&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">==</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">4</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br><img id=Codehighlighter1_1602_1821_Open_Image onclick="this.style.display='none'; Codehighlighter1_1602_1821_Open_Text.style.display='none'; Codehighlighter1_1602_1821_Closed_Image.style.display='inline'; Codehighlighter1_1602_1821_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1602_1821_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1602_1821_Closed_Text.style.display='none'; Codehighlighter1_1602_1821_Open_Image.style.display='inline'; Codehighlighter1_1602_1821_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_1602_1821_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1602_1821_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;(xmlhttp.status&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">==</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">200</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br><img id=Codehighlighter1_1647_1730_Open_Image onclick="this.style.display='none'; Codehighlighter1_1647_1730_Open_Text.style.display='none'; Codehighlighter1_1647_1730_Closed_Image.style.display='inline'; Codehighlighter1_1647_1730_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1647_1730_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1647_1730_Closed_Text.style.display='none'; Codehighlighter1_1647_1730_Open_Image.style.display='inline'; Codehighlighter1_1647_1730_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_1647_1730_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1647_1730_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(a).innerHTML&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;xmlhttp.responseText;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">else</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img id=Codehighlighter1_1753_1815_Open_Image onclick="this.style.display='none'; Codehighlighter1_1753_1815_Open_Text.style.display='none'; Codehighlighter1_1753_1815_Closed_Image.style.display='inline'; Codehighlighter1_1753_1815_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1753_1815_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1753_1815_Closed_Text.style.display='none'; Codehighlighter1_1753_1815_Open_Image.style.display='inline'; Codehighlighter1_1753_1815_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_1753_1815_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1753_1815_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">HTTP&nbsp;错误，状态码：</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;xmlhttp.status);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;<br><img id=Codehighlighter1_1830_1915_Open_Image onclick="this.style.display='none'; Codehighlighter1_1830_1915_Open_Text.style.display='none'; Codehighlighter1_1830_1915_Closed_Image.style.display='inline'; Codehighlighter1_1830_1915_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1830_1915_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1830_1915_Closed_Text.style.display='none'; Codehighlighter1_1830_1915_Open_Image.style.display='inline'; Codehighlighter1_1830_1915_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">else</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span id=Codehighlighter1_1830_1915_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1830_1915_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{//显示一个等待响应的图片<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(a).innerHTML&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;img&nbsp;src=tpl/1-0.gif&nbsp;align=absmiddle&gt;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img id=Codehighlighter1_1939_1993_Open_Image onclick="this.style.display='none'; Codehighlighter1_1939_1993_Open_Text.style.display='none'; Codehighlighter1_1939_1993_Closed_Image.style.display='inline'; Codehighlighter1_1939_1993_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1939_1993_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1939_1993_Closed_Text.style.display='none'; Codehighlighter1_1939_1993_Open_Image.style.display='inline'; Codehighlighter1_1939_1993_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;loadall()</span><span id=Codehighlighter1_1939_1993_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1939_1993_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>SubmitMsg(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">a1</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>SubmitMsg(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">a2</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>SubmitMsg(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">a3</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">--&gt;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">script</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">body&nbsp;</span><span style="COLOR: #ff0000">onload</span><span style="COLOR: #0000ff">=loadall()</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">div&nbsp;</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="a1"</span><span style="COLOR: #ff0000">&nbsp;style</span><span style="COLOR: #0000ff">="border:1px&nbsp;solid&nbsp;red;float:left"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">1</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">div</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">div&nbsp;</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="a2"</span><span style="COLOR: #ff0000">&nbsp;style</span><span style="COLOR: #0000ff">="border:1px&nbsp;solid&nbsp;green;float:left"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">2</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">div</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">div&nbsp;</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="a3"</span><span style="COLOR: #ff0000">&nbsp;style</span><span style="COLOR: #0000ff">="border:1px&nbsp;solid&nbsp;yellow"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">3</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">div</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">&gt;</span></div>
</div>
<p style="FONT-SIZE: 14pt">后台程序</p>
<p style="FONT-SIZE: 14pt"></p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">&lt;%</span><span style="COLOR: #000000">@&nbsp;Page&nbsp;Language</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">C#</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">%&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;%</span><span style="COLOR: #000000">Response.Expires&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;&nbsp;</span><span style="COLOR: #000000">%&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;!</span><span style="COLOR: #000000">DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Transitional//EN</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">script&nbsp;runat</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">server</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Page_Load(</span><span style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br><img id=Codehighlighter1_250_638_Open_Image onclick="this.style.display='none'; Codehighlighter1_250_638_Open_Text.style.display='none'; Codehighlighter1_250_638_Closed_Image.style.display='inline'; Codehighlighter1_250_638_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_250_638_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_250_638_Closed_Text.style.display='none'; Codehighlighter1_250_638_Open_Image.style.display='inline'; Codehighlighter1_250_638_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_250_638_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_250_638_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(Request.QueryString[</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">a</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">a1</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)<br><img id=Codehighlighter1_306_374_Open_Image onclick="this.style.display='none'; Codehighlighter1_306_374_Open_Text.style.display='none'; Codehighlighter1_306_374_Closed_Image.style.display='inline'; Codehighlighter1_306_374_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_306_374_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_306_374_Closed_Text.style.display='none'; Codehighlighter1_306_374_Open_Image.style.display='inline'; Codehighlighter1_306_374_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_306_374_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_306_374_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Threading.Thread.Sleep(</span><span style="COLOR: #000000">3000</span><span style="COLOR: #000000">);&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">延时&nbsp;3&nbsp;秒</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(Request.QueryString[</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">a</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">a2</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)<br><img id=Codehighlighter1_435_503_Open_Image onclick="this.style.display='none'; Codehighlighter1_435_503_Open_Text.style.display='none'; Codehighlighter1_435_503_Closed_Image.style.display='inline'; Codehighlighter1_435_503_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_435_503_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_435_503_Closed_Text.style.display='none'; Codehighlighter1_435_503_Open_Image.style.display='inline'; Codehighlighter1_435_503_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_435_503_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_435_503_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Threading.Thread.Sleep(</span><span style="COLOR: #000000">1000</span><span style="COLOR: #000000">);&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">延时&nbsp;1&nbsp;秒</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(Request.QueryString[</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">a</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">a3</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)<br><img id=Codehighlighter1_564_632_Open_Image onclick="this.style.display='none'; Codehighlighter1_564_632_Open_Text.style.display='none'; Codehighlighter1_564_632_Closed_Image.style.display='inline'; Codehighlighter1_564_632_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_564_632_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_564_632_Closed_Text.style.display='none'; Codehighlighter1_564_632_Open_Image.style.display='inline'; Codehighlighter1_564_632_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_564_632_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_564_632_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Threading.Thread.Sleep(</span><span style="COLOR: #000000">2000</span><span style="COLOR: #000000">);&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">延时&nbsp;2&nbsp;秒</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">script</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">html&nbsp;xmlns</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">http://www.w3.org/1999/xhtml</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">head&nbsp;runat</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">server</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">title</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">Ajax&nbsp;Test</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">title</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">head</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">body</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">form&nbsp;id</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">form1</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;runat</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">server</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">div</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">div</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">form</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">body</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">html</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></div>
<p style="FONT-SIZE: 14pt">演示解说</p>
<p style="FONT-SIZE: 14pt">前台页面发出三个异步回送请求，分别为 a1、a2、a3 请求值，在后台页面中，通过延时模拟处理 a1 需要 3 秒，处理 a2 需要 1 秒，处理 a3 需要 2 秒。通过演示发现最先有变化的是 a2，然后是 a3、a1，顺序并没有乱，也没有出现显示混乱的情况。注意后台页面需要 Response.Expires = 0; 这么一句代码指示页面立即过期，否则刷新时请求的是缓存的页面，演示也就没有效果了。</p>
<p style="FONT-SIZE: 14pt">另外</p>
<p style="FONT-SIZE: 14pt">每个 xmlhttp 的 onreadystatechange <span style="COLOR: red">对应的函数名称也可以不同，不仅限于参数不同</span>。<br></p>
<img src ="http://www.phpweblog.net/fuyongjie/aggbug/3654.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/fuyongjie/" target="_blank">bestmost</a> 2008-05-21 16:03 <a href="http://www.phpweblog.net/fuyongjie/archive/2008/05/21/3654.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>