﻿<?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博客-鱼有所思,鱼有所悟-随笔分类-AJAX</title><link>http://www.phpweblog.net/kiyone/category/196.html</link><description>做个不错的人，微笑面对人生</description><language>zh-cn</language><lastBuildDate>Thu, 15 May 2008 16:09:23 GMT</lastBuildDate><pubDate>Thu, 15 May 2008 16:09:23 GMT</pubDate><ttl>60</ttl><item><title>PHP+JavaScript 实现动态显示服务器端运行进度条(转)</title><link>http://www.phpweblog.net/kiyone/archive/2008/05/15/3393.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Thu, 15 May 2008 08:34:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2008/05/15/3393.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/3393.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2008/05/15/3393.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/3393.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/3393.html</trackback:ping><description><![CDATA[<span id=zoom>我有一个 PHP 程序，需要循环调用 XMLRPC 500 次左右，运行 20 多分钟。当程序运行的时候，客户端只有一片空白的页面，浏览器的状态一直是 load。作为用户来说，这种等待是漫长的，埋怨也就多了。<br><br>解决思路<br><br>如果有个进度条呈现在用户面前，告诉用户服务器端正在干嘛，当前运行了多少，问题就可以得到基本解决，虽然没有减少服务器端的运行时间，但用户的心里会有微妙的变化，感觉不再是枯燥无味的等待，至少等待还有个盼头 :) 。<br><br>考虑到每一次调用 XMLRPC 比较耗时，所以可以在每一次调用时使用 PHP 的 flush() 函数输出一段 JavaScript 对客户端浏览器中进度条显示进行动态更新。<br><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 id=Code_Closed_Image_163318 onclick="this.style.display='none'; Code_Closed_Text_163318.style.display='none'; Code_Open_Image_163318.style.display='inline'; Code_Open_Text_163318.style.display='inline';" height=16 src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" width=11 align=top><img id=Code_Open_Image_163318 style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_163318.style.display='none'; Code_Closed_Image_163318.style.display='inline'; Code_Closed_Text_163318.style.display='inline';" height=16 src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><span id=Code_Closed_Text_163318 style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"></span><span id=Code_Open_Text_163318 style="DISPLAY: none"><br><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">&lt;?</span><span style="COLOR: #ff00ff">php<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>if&nbsp;('source'&nbsp;==&nbsp;$_GET['act'])&nbsp;&nbsp;//查看源代码<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>&nbsp;&nbsp;&nbsp;&nbsp;show_source($_SERVER["SCRIPT_FILENAME"]);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<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>set_time_limit(0);<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>for&nbsp;($i&nbsp;=&nbsp;0;&nbsp;$i&nbsp;&lt;&nbsp;500;&nbsp;$i++)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;$users[]&nbsp;=&nbsp;'Tom_'&nbsp;.&nbsp;$i;<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><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>$width&nbsp;=&nbsp;500;&nbsp;&nbsp;&nbsp;//显示的进度条长度，单位&nbsp;px<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>$total&nbsp;=&nbsp;count($users);&nbsp;//总共需要操作的记录数<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>$pix&nbsp;=&nbsp;$width&nbsp;/&nbsp;$total;&nbsp;//每条记录的操作所占的进度条单位长度<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>$progress&nbsp;=&nbsp;0;&nbsp;&nbsp;//当前进度条长度<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></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">html</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">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">动态显示服务器运行程序的进度条</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></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=gb2312"</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">meta&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="Generator"</span><span style="COLOR: #ff0000">&nbsp;content</span><span style="COLOR: #0000ff">="JEdit"</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">name</span><span style="COLOR: #0000ff">="Author"</span><span style="COLOR: #ff0000">&nbsp;content</span><span style="COLOR: #0000ff">="Krazy&nbsp;Nio"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img id=Codehighlighter1_537_593_Open_Image onclick="this.style.display='none'; Codehighlighter1_537_593_Open_Text.style.display='none'; Codehighlighter1_537_593_Closed_Image.style.display='inline'; Codehighlighter1_537_593_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_537_593_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_537_593_Closed_Text.style.display='none'; Codehighlighter1_537_593_Open_Image.style.display='inline'; Codehighlighter1_537_593_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">style</span><span style="COLOR: #0000ff">&gt;</span><span id=Codehighlighter1_537_593_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_537_593_Open_Text><span style="COLOR: #800000; BACKGROUND-COLOR: #f5f5f5"><br><img id=Codehighlighter1_554_592_Open_Image onclick="this.style.display='none'; Codehighlighter1_554_592_Open_Text.style.display='none'; Codehighlighter1_554_592_Closed_Image.style.display='inline'; Codehighlighter1_554_592_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_554_592_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_554_592_Closed_Text.style.display='none'; Codehighlighter1_554_592_Open_Image.style.display='inline'; Codehighlighter1_554_592_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>body,&nbsp;div&nbsp;input&nbsp;</span><span id=Codehighlighter1_554_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_554_592_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{</span><span style="COLOR: #ff0000; BACKGROUND-COLOR: #f5f5f5">&nbsp;font-family</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">&nbsp;Tahoma</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;</span><span style="COLOR: #ff0000; BACKGROUND-COLOR: #f5f5f5">&nbsp;font-size</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">&nbsp;9pt&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">}</span></span><span style="COLOR: #800000; 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">style</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img id=Codehighlighter1_633_917_Open_Image onclick="this.style.display='none'; Codehighlighter1_633_917_Open_Text.style.display='none'; Codehighlighter1_633_917_Closed_Image.style.display='inline'; Codehighlighter1_633_917_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_633_917_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_633_917_Closed_Text.style.display='none'; Codehighlighter1_633_917_Open_Image.style.display='inline'; Codehighlighter1_633_917_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">language</span><span style="COLOR: #0000ff">="JavaScript"</span><span style="COLOR: #0000ff">&gt;</span><span id=Codehighlighter1_633_917_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_633_917_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></span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;updateProgress(sMsg,&nbsp;iWidth)<br><img id=Codehighlighter1_677_910_Open_Image onclick="this.style.display='none'; Codehighlighter1_677_910_Open_Text.style.display='none'; Codehighlighter1_677_910_Closed_Image.style.display='inline'; Codehighlighter1_677_910_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_677_910_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_677_910_Closed_Text.style.display='none'; Codehighlighter1_677_910_Open_Image.style.display='inline'; Codehighlighter1_677_910_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_677_910_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_677_910_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">status</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).innerHTML&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;sMsg;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">progress</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).style.width&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;iWidth&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">px</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>&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">percent</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).innerHTML&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;parseInt(iWidth&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">&lt;?</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">php&nbsp;echo&nbsp;$width;&nbsp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">?&gt;</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;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">100</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;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">%</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>}</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">--&gt;</span><span style="COLOR: #008000; 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">&nbsp;&nbsp;&nbsp;&nbsp;<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</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">style</span><span style="COLOR: #0000ff">="margin:&nbsp;4px;&nbsp;padding:&nbsp;8px;&nbsp;border:&nbsp;1px&nbsp;solid&nbsp;gray;&nbsp;background:&nbsp;#EAEAEA;&nbsp;width:&nbsp;&lt;?php&nbsp;echo&nbsp;$width+8;&nbsp;?&gt;px"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">div</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">font&nbsp;</span><span style="COLOR: #ff0000">color</span><span style="COLOR: #0000ff">="gray"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">如下进度条的动态效果由服务器端&nbsp;PHP&nbsp;程序结合客户端&nbsp;JavaScript&nbsp;程序生成。</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">font</span><span style="COLOR: #0000ff">&gt;&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>&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">div&nbsp;</span><span style="COLOR: #ff0000">style</span><span style="COLOR: #0000ff">="padding:&nbsp;0;&nbsp;background-color:&nbsp;white;&nbsp;border:&nbsp;1px&nbsp;solid&nbsp;navy;&nbsp;width:&nbsp;&lt;?php&nbsp;echo&nbsp;$width;&nbsp;?&gt;px"</span><span style="COLOR: #0000ff">&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">&lt;</span><span style="COLOR: #800000">div&nbsp;</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="progress"</span><span style="COLOR: #ff0000">&nbsp;style</span><span style="COLOR: #0000ff">="padding:&nbsp;0;&nbsp;background-color:&nbsp;#FFCC66;&nbsp;border:&nbsp;0;&nbsp;width:&nbsp;0px;&nbsp;text-align:&nbsp;center;&nbsp;&nbsp;height:&nbsp;16px"</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">div</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</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>&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">div&nbsp;</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="status"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #ff0000">&amp;nbsp;</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>&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">div&nbsp;</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="percent"</span><span style="COLOR: #ff0000">&nbsp;style</span><span style="COLOR: #0000ff">="position:&nbsp;relative;&nbsp;top:&nbsp;-30px;&nbsp;text-align:&nbsp;center;&nbsp;font-weight:&nbsp;bold;&nbsp;font-size:&nbsp;8pt"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">0%</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</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: #ff00ff">php<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>flush();&nbsp;&nbsp;&nbsp;&nbsp;//将输出发送给客户端浏览器<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>foreach&nbsp;($users&nbsp;as&nbsp;$user)//在此处使用空循环模拟较为耗时的操作，实际应用中需将其替换；若你的操作不耗时，我想你就没必要使用这个脚本了)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;($i&nbsp;=&nbsp;0;&nbsp;$i&nbsp;&lt;&nbsp;10000;&nbsp;$i++)&nbsp;{&nbsp;<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>}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">?&gt;</span><span style="COLOR: #000000"><br><img id=Codehighlighter1_1761_1861_Open_Image onclick="this.style.display='none'; Codehighlighter1_1761_1861_Open_Text.style.display='none'; Codehighlighter1_1761_1861_Closed_Image.style.display='inline'; Codehighlighter1_1761_1861_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_1761_1861_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1761_1861_Closed_Text.style.display='none'; Codehighlighter1_1761_1861_Open_Image.style.display='inline'; Codehighlighter1_1761_1861_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">language</span><span style="COLOR: #0000ff">="JavaScript"</span><span style="COLOR: #0000ff">&gt;</span><span id=Codehighlighter1_1761_1861_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_1761_1861_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>updateProgress(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">正在操作用户&#8220;&lt;?php&nbsp;echo&nbsp;$user;&nbsp;?&gt;&#8221;&nbsp;<img src="http://www.phpweblog.net/Images/dot.gif">.</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">&lt;?</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">php&nbsp;echo&nbsp;min($width,&nbsp;intval($progress));&nbsp;</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></span><span style="COLOR: #0000ff">&lt;?</span><span style="COLOR: #ff00ff">php<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>flush();&nbsp;&nbsp;&nbsp;&nbsp;//将输出发送给客户端浏览器，使其可以立即执行服务器端输出的&nbsp;JavaScript&nbsp;程序。<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>$progress&nbsp;+=&nbsp;$pix;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}&nbsp;&nbsp;&nbsp;//end&nbsp;foreach<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>//&nbsp;&nbsp;最后将进度条设置成最大值&nbsp;$width，同时显示操作完成<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">?&gt;</span><span style="COLOR: #000000"><br><img id=Codehighlighter1_2043_2091_Open_Image onclick="this.style.display='none'; Codehighlighter1_2043_2091_Open_Text.style.display='none'; Codehighlighter1_2043_2091_Closed_Image.style.display='inline'; Codehighlighter1_2043_2091_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_2043_2091_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2043_2091_Closed_Text.style.display='none'; Codehighlighter1_2043_2091_Open_Image.style.display='inline'; Codehighlighter1_2043_2091_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">language</span><span style="COLOR: #0000ff">="JavaScript"</span><span style="COLOR: #0000ff">&gt;</span><span id=Codehighlighter1_2043_2091_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_2043_2091_Open_Text><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>updateProgress(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">操作完成！</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">&lt;?</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">php&nbsp;echo&nbsp;$width;&nbsp;</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></span><span style="COLOR: #0000ff">&lt;?</span><span style="COLOR: #ff00ff">php<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>flush();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></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">input&nbsp;</span><span style="COLOR: #ff0000">type</span><span style="COLOR: #0000ff">="button"</span><span style="COLOR: #ff0000">&nbsp;value</span><span style="COLOR: #0000ff">="查看源码"</span><span style="COLOR: #ff0000">&nbsp;onclick</span><span style="COLOR: #0000ff">="document.location.href='&lt;?php&nbsp;echo&nbsp;$_SERVER['PHP_SELF'];&nbsp;?&gt;?act=source'"</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">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><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></span></div>
</span>
<img src ="http://www.phpweblog.net/kiyone/aggbug/3393.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2008-05-15 16:34 <a href="http://www.phpweblog.net/kiyone/archive/2008/05/15/3393.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>取服务器端的时间并不停显示在网页上</title><link>http://www.phpweblog.net/kiyone/archive/2007/07/05/1435.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Thu, 05 Jul 2007 03:44:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/07/05/1435.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/1435.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/07/05/1435.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/1435.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/1435.html</trackback:ping><description><![CDATA[<div class=t_msgfont id=message508204>比如：在js脚本里new Date后，取得的是客户端的时间，而服务器端的时间是 （2007-07-04 11:22:33），怎样把这个时间显示在网页上并不停地走？</div>
<br style="CLEAR: both"><font color=#ff0000>思路是用AJAX的方法，以在IE6.0 Firefox Opera测试通过<br><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 id=Code_Closed_Image_114213 onclick="this.style.display='none'; Code_Closed_Text_114213.style.display='none'; Code_Open_Image_114213.style.display='inline'; Code_Open_Text_114213.style.display='inline';" height=16 src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" width=11 align=top><img id=Code_Open_Image_114213 style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_114213.style.display='none'; Code_Closed_Image_114213.style.display='inline'; Code_Closed_Text_114213.style.display='inline';" height=16 src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><span id=Code_Closed_Text_114213 style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"></span><span id=Code_Open_Text_114213 style="DISPLAY: none"><br><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><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;HTML&nbsp;4.0&nbsp;Transitional//EN</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">span&nbsp;id</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">spnTime</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;&lt;/</span><span style="COLOR: #000000">span</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;language</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"><br><img id=Codehighlighter1_154_920_Open_Image onclick="this.style.display='none'; Codehighlighter1_154_920_Open_Text.style.display='none'; Codehighlighter1_154_920_Closed_Image.style.display='inline'; Codehighlighter1_154_920_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_154_920_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_154_920_Closed_Text.style.display='none'; Codehighlighter1_154_920_Open_Image.style.display='inline'; Codehighlighter1_154_920_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">&nbsp;createXMLHttpRequest&nbsp;()&nbsp;</span><span id=Codehighlighter1_154_920_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_154_920_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;request&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br><img id=Codehighlighter1_211_356_Open_Image onclick="this.style.display='none'; Codehighlighter1_211_356_Open_Text.style.display='none'; Codehighlighter1_211_356_Closed_Image.style.display='inline'; Codehighlighter1_211_356_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_211_356_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_211_356_Closed_Text.style.display='none'; Codehighlighter1_211_356_Open_Image.style.display='inline'; Codehighlighter1_211_356_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">if</span><span style="COLOR: #000000">(window.XMLHttpRequest)&nbsp;</span><span id=Codehighlighter1_211_356_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_211_356_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;request&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;XMLHttpRequest();<br><img id=Codehighlighter1_290_350_Open_Image onclick="this.style.display='none'; Codehighlighter1_290_350_Open_Text.style.display='none'; Codehighlighter1_290_350_Closed_Image.style.display='inline'; Codehighlighter1_290_350_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_290_350_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_290_350_Closed_Text.style.display='none'; Codehighlighter1_290_350_Open_Image.style.display='inline'; Codehighlighter1_290_350_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 style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(request.overrideMimeType)&nbsp;</span><span id=Codehighlighter1_290_350_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_290_350_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;request.overrideMimeType('text</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">xml');<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"><br><img id=Codehighlighter1_388_898_Open_Image onclick="this.style.display='none'; Codehighlighter1_388_898_Open_Text.style.display='none'; Codehighlighter1_388_898_Closed_Image.style.display='inline'; Codehighlighter1_388_898_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_388_898_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_388_898_Closed_Text.style.display='none'; Codehighlighter1_388_898_Open_Image.style.display='inline'; Codehighlighter1_388_898_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(window.ActiveXObject)&nbsp;</span><span id=Codehighlighter1_388_898_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_388_898_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">var</span><span style="COLOR: #000000">&nbsp;versions&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;['Microsoft.XMLHTTP',&nbsp;'MSXML.XMLHTTP',&nbsp;'Microsoft.XMLHTTP',&nbsp;'Msxml2.XMLHTTP.</span><span style="COLOR: #000000">7.0</span><span style="COLOR: #000000">',&nbsp;'Msxml2.XMLHTTP.</span><span style="COLOR: #000000">6.0</span><span style="COLOR: #000000">',&nbsp;'Msxml2.XMLHTTP.</span><span style="COLOR: #000000">5.0</span><span style="COLOR: #000000">',&nbsp;'Msxml2.XMLHTTP.</span><span style="COLOR: #000000">4.0</span><span style="COLOR: #000000">',&nbsp;'MSXML2.XMLHTTP.</span><span style="COLOR: #000000">3.0</span><span style="COLOR: #000000">',&nbsp;'MSXML2.XMLHTTP'];<br><img id=Codehighlighter1_647_892_Open_Image onclick="this.style.display='none'; Codehighlighter1_647_892_Open_Text.style.display='none'; Codehighlighter1_647_892_Closed_Image.style.display='inline'; Codehighlighter1_647_892_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_647_892_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_647_892_Closed_Text.style.display='none'; Codehighlighter1_647_892_Open_Image.style.display='inline'; Codehighlighter1_647_892_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 style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;&nbsp;i</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">versions.length;&nbsp;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)&nbsp;</span><span id=Codehighlighter1_647_892_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_647_892_Open_Text><span style="COLOR: #000000">{<br><img id=Codehighlighter1_665_821_Open_Image onclick="this.style.display='none'; Codehighlighter1_665_821_Open_Text.style.display='none'; Codehighlighter1_665_821_Closed_Image.style.display='inline'; Codehighlighter1_665_821_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_665_821_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_665_821_Closed_Text.style.display='none'; Codehighlighter1_665_821_Open_Image.style.display='inline'; Codehighlighter1_665_821_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">try</span><span style="COLOR: #000000">&nbsp;</span><span id=Codehighlighter1_665_821_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_665_821_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;&nbsp;&nbsp;&nbsp;&nbsp;request&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;ActiveXObject(versions[i]);<br><img id=Codehighlighter1_753_807_Open_Image onclick="this.style.display='none'; Codehighlighter1_753_807_Open_Text.style.display='none'; Codehighlighter1_753_807_Closed_Image.style.display='inline'; Codehighlighter1_753_807_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_753_807_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_753_807_Closed_Text.style.display='none'; Codehighlighter1_753_807_Open_Image.style.display='inline'; Codehighlighter1_753_807_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(request)&nbsp;</span><span id=Codehighlighter1_753_807_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_753_807_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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;request;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_832_882_Open_Image onclick="this.style.display='none'; Codehighlighter1_832_882_Open_Text.style.display='none'; Codehighlighter1_832_882_Closed_Image.style.display='inline'; Codehighlighter1_832_882_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_832_882_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_832_882_Closed_Text.style.display='none'; Codehighlighter1_832_882_Open_Image.style.display='inline'; Codehighlighter1_832_882_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">catch</span><span style="COLOR: #000000">(e)&nbsp;</span><span id=Codehighlighter1_832_882_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_832_882_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;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">alert(e.message);</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;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><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"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&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;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;request;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;http&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;createXMLHttpRequest();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>http.open(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">HEAD</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">,&nbsp;</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>http.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><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;curDate&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;Date;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;offsetTime&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;curDate&nbsp;</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">&nbsp;Date.parse(http.getResponseHeader(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Date</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>setInterval(</span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">()<br><img id=Codehighlighter1_1123_1246_Open_Image onclick="this.style.display='none'; Codehighlighter1_1123_1246_Open_Text.style.display='none'; Codehighlighter1_1123_1246_Closed_Image.style.display='inline'; Codehighlighter1_1123_1246_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_1123_1246_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1123_1246_Closed_Text.style.display='none'; Codehighlighter1_1123_1246_Open_Image.style.display='inline'; Codehighlighter1_1123_1246_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_1123_1246_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_1123_1246_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;curDate.setTime(</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;Date&nbsp;</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">&nbsp;offsetTime);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">spnTime</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">).innerHTML&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;curDate.toLocaleString();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">1000</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></div>
<br>参考<a href="http://bbs.51js.com/viewthread.php?tid=69899">http://bbs.51js.com/viewthread.php?tid=69899</a><br></font>
<img src ="http://www.phpweblog.net/kiyone/aggbug/1435.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-07-05 11:44 <a href="http://www.phpweblog.net/kiyone/archive/2007/07/05/1435.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>复选框全选</title><link>http://www.phpweblog.net/kiyone/archive/2007/05/28/1269.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Mon, 28 May 2007 10:38:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/05/28/1269.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/1269.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/05/28/1269.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/1269.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/1269.html</trackback:ping><description><![CDATA[不在form中的情况：<br>function CheckAll()<br>{<br>&nbsp;&nbsp;&nbsp; arr= new Array("aa","bb","cc","dd");<br>&nbsp;&nbsp;&nbsp; for (var i=0;i&lt;arr.length;i++)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var e = arr[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eval(document.getElementById(e)).checked = (document.getElementById(e).checked != true ? true : false);<br>&nbsp;&nbsp;&nbsp; }<br>}<br>在form中的情况：<br>function CheckAll(form)<br>{<br>&nbsp;&nbsp;&nbsp; for (var i=0;i&lt;form.elements.length;i++)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; var e = form.elements[i];<br>&nbsp;&nbsp;&nbsp; if (e.name != 'chkall')<br>&nbsp;&nbsp;&nbsp; e.checked = form.chkall.checked;<br>&nbsp;&nbsp;&nbsp; }<br>}
<img src ="http://www.phpweblog.net/kiyone/aggbug/1269.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-05-28 18:38 <a href="http://www.phpweblog.net/kiyone/archive/2007/05/28/1269.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>js中innerHTML与innerText的用法与区别</title><link>http://www.phpweblog.net/kiyone/archive/2007/05/17/1206.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Thu, 17 May 2007 02:46:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/05/17/1206.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/1206.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/05/17/1206.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/1206.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/1206.html</trackback:ping><description><![CDATA[<div>
<p>用法：<br><br>&lt;div&nbsp;id="test"&gt;<br>&nbsp;&nbsp;&nbsp;&lt;span&nbsp;style="color:red"&gt;test1&lt;/span&gt;&nbsp;test2<br>&lt;/div&gt;<br><br>在JS中可以使用：<br><br><strong>test.innerHTML</strong>:</p>
<p>　　也就是从对象的起始位置到终止位置的全部内容,包括Html标签。 </p>
<p>　　上例中的test.innerHTML的值也就是&#8220;&lt;span&nbsp;style="color:red"&gt;test1&lt;/span&gt;&nbsp;test2 &#8221;。<br><br><strong>test.innerText:</strong>&nbsp;</p>
<p>　　从起始位置到终止位置的内容,&nbsp;但它去除Html标签&nbsp;</p>
<p>　　上例中的text.innerTest的值也就是&#8220;test1&nbsp;test2&#8221;,&nbsp;其中span标签去除了。 </p>
<p><strong>test.outerHTML:</strong></p>
<p><strong>　　</strong>除了包含innerHTML的全部内容外,&nbsp;还包含对象标签本身。</p>
<p>　　上例中的text.outerHTML的值也就是&lt;div&nbsp;id="test"&gt;&lt;span&nbsp;style="color:red"&gt;test1&lt;/span&gt;&nbsp;test2&lt;/div&gt;</p>
<p><strong><br>完整示例：</strong></p>
<p>&lt;div&nbsp;id="test"&gt;<br>&nbsp;&nbsp;&nbsp;&lt;span&nbsp;style="color:red"&gt;test1&lt;/span&gt;&nbsp;test2<br>&lt;/div&gt;<br><br>&lt;a href="javascript:alert(test.innerHTML)"&gt;innerHTML内容&lt;/a&gt;<br>&lt;a href="javascript:alert(test.innerText)"&gt;inerHTML内容&lt;/a&gt;<br>&lt;a href="javascript:alert(test.outerHTML)"&gt;outerHTML内容&lt;/a&gt;<br><br><strong>特别说明：</strong></p>
<p><strong>　　</strong>innerHTML是符合W3C标准的属性，而innerText只适用于IE浏览器，因此，尽可能地去使用innerHTML，而少用innerText，如果要输出不含HTML标签的内容，可以使用innerHTML取得包含HTML标签的内容后，再用正则表达式去除HTML标签，下面是一个简单的符合W3C标准的示例：<br><br>&lt;a href="javascript:alert(document.getElementById('test').innerHTML.replace(/&lt;.+?&gt;/gim,''))"&gt;无HTML,符合W3C标准&lt;/a&gt;<br><br>-------------------------------------------------------------------------------------------------------------------------------<br><br>&lt;html&gt;<br>&lt;head&gt;&lt;/head&gt;<br>&lt;frameset frameborder="yes" frameborder="1" rows="40%,*"&gt;<br>&lt;frame name="top" src="1.html"&gt;<br>&lt;frame name="bottom" src="2.html"&gt;<br>&lt;/frameset&gt;<br>&lt;/html&gt;<br><br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;script language="javascript"&gt;<br>function init()<br>{&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; var aaa = parent.window.frames[0].document.body.innerHTML; <br>&nbsp;&nbsp;&nbsp; alert(aaa);<br>}<br>&lt;/script&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;p align="center"&gt;nothing&lt;/p&gt;<br>&lt;p align="center"&gt;&lt;input type="button" onclick="init()"; value="click"&gt;&lt;/p&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br><br>&lt;html&gt;<br>&lt;center&gt;汽车 房产 女人&lt;/center&gt;<br>&lt;/html&gt;<br></p>
</div>
<img src ="http://www.phpweblog.net/kiyone/aggbug/1206.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-05-17 10:46 <a href="http://www.phpweblog.net/kiyone/archive/2007/05/17/1206.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何实现文本框焦点自动跳转及通过回车键提交表单 </title><link>http://www.phpweblog.net/kiyone/archive/2007/04/19/1139.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Thu, 19 Apr 2007 13:13:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/04/19/1139.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/1139.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/04/19/1139.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/1139.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/1139.html</trackback:ping><description><![CDATA[<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 id=Code_Closed_Image_120934 onclick="this.style.display='none'; Code_Closed_Text_120934.style.display='none'; Code_Open_Image_120934.style.display='inline'; Code_Open_Text_120934.style.display='inline';" height=16 src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" width=11 align=top><img id=Code_Open_Image_120934 style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_120934.style.display='none'; Code_Closed_Image_120934.style.display='inline'; Code_Closed_Text_120934.style.display='inline';" height=16 src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><span id=Code_Closed_Text_120934 style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"></span><span id=Code_Open_Text_120934 style="DISPLAY: none"><br><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">&nbsp;init()&nbsp;<br><img id=Codehighlighter1_17_53_Open_Image onclick="this.style.display='none'; Codehighlighter1_17_53_Open_Text.style.display='none'; Codehighlighter1_17_53_Closed_Image.style.display='inline'; Codehighlighter1_17_53_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_17_53_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_17_53_Closed_Text.style.display='none'; Codehighlighter1_17_53_Open_Image.style.display='inline'; Codehighlighter1_17_53_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_17_53_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_17_53_Open_Text><span style="COLOR: #000000">{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;document.onkeydown</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">keyDown&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">&nbsp;keyDown(e)&nbsp;<br><img id=Codehighlighter1_77_175_Open_Image onclick="this.style.display='none'; Codehighlighter1_77_175_Open_Text.style.display='none'; Codehighlighter1_77_175_Closed_Image.style.display='inline'; Codehighlighter1_77_175_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_77_175_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_77_175_Closed_Text.style.display='none'; Codehighlighter1_77_175_Open_Image.style.display='inline'; Codehighlighter1_77_175_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_77_175_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_77_175_Open_Text><span style="COLOR: #000000">{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(event.keyCode</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">13</span><span style="COLOR: #000000">)&nbsp;<br><img id=Codehighlighter1_111_143_Open_Image onclick="this.style.display='none'; Codehighlighter1_111_143_Open_Text.style.display='none'; Codehighlighter1_111_143_Closed_Image.style.display='inline'; Codehighlighter1_111_143_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_111_143_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_111_143_Closed_Text.style.display='none'; Codehighlighter1_111_143_Open_Image.style.display='inline'; Codehighlighter1_111_143_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_111_143_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_111_143_Open_Text><span style="COLOR: #000000">{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.keyCode</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">9</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">body&nbsp;&nbsp;onload</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">init()</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">&nbsp;</span></span></div>
<br>这是javascript版的. 
<img src ="http://www.phpweblog.net/kiyone/aggbug/1139.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-04-19 21:13 <a href="http://www.phpweblog.net/kiyone/archive/2007/04/19/1139.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Keycode对照表</title><link>http://www.phpweblog.net/kiyone/archive/2007/04/19/1138.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Thu, 19 Apr 2007 13:10:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/04/19/1138.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/1138.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/04/19/1138.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/1138.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/1138.html</trackback:ping><description><![CDATA[<table class=" FCK__ShowTableBorders" cellSpacing=1 cellPadding=1 width="100%" bgColor=#999999 border=0 _fckxhtmljob="1">
    <tbody _fckxhtmljob="1">
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td colSpan=8 _fckxhtmljob="1"><strong _fckxhtmljob="1">字母和数字键的键码值(keyCode)</strong></td>
        </tr>
        <tr align=middle bgColor=#dddddd _fckxhtmljob="1">
            <td _fckxhtmljob="1">按键</td>
            <td _fckxhtmljob="1">键码</td>
            <td _fckxhtmljob="1">按键</td>
            <td _fckxhtmljob="1">键码</td>
            <td _fckxhtmljob="1">按键</td>
            <td _fckxhtmljob="1">键码</td>
            <td _fckxhtmljob="1">按键</td>
            <td _fckxhtmljob="1">键码</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">A</td>
            <td _fckxhtmljob="1">65</td>
            <td _fckxhtmljob="1">J</td>
            <td _fckxhtmljob="1">74</td>
            <td _fckxhtmljob="1">S</td>
            <td _fckxhtmljob="1">83</td>
            <td _fckxhtmljob="1">1</td>
            <td _fckxhtmljob="1">49</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">B</td>
            <td _fckxhtmljob="1">66</td>
            <td _fckxhtmljob="1">K</td>
            <td _fckxhtmljob="1">75</td>
            <td _fckxhtmljob="1">T</td>
            <td _fckxhtmljob="1">84</td>
            <td _fckxhtmljob="1">2</td>
            <td _fckxhtmljob="1">50</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">C</td>
            <td _fckxhtmljob="1">67</td>
            <td _fckxhtmljob="1">L</td>
            <td _fckxhtmljob="1">76</td>
            <td _fckxhtmljob="1">U</td>
            <td _fckxhtmljob="1">85</td>
            <td _fckxhtmljob="1">3</td>
            <td _fckxhtmljob="1">51</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">D</td>
            <td _fckxhtmljob="1">68</td>
            <td _fckxhtmljob="1">M</td>
            <td _fckxhtmljob="1">77</td>
            <td _fckxhtmljob="1">V</td>
            <td _fckxhtmljob="1">86</td>
            <td _fckxhtmljob="1">4</td>
            <td _fckxhtmljob="1">52</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">E</td>
            <td _fckxhtmljob="1">69</td>
            <td _fckxhtmljob="1">N</td>
            <td _fckxhtmljob="1">78</td>
            <td _fckxhtmljob="1">W</td>
            <td _fckxhtmljob="1">87</td>
            <td _fckxhtmljob="1">5</td>
            <td _fckxhtmljob="1">53</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">F</td>
            <td _fckxhtmljob="1">70</td>
            <td _fckxhtmljob="1">O</td>
            <td _fckxhtmljob="1">79</td>
            <td _fckxhtmljob="1">X</td>
            <td _fckxhtmljob="1">88</td>
            <td _fckxhtmljob="1">6</td>
            <td _fckxhtmljob="1">54</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">G</td>
            <td _fckxhtmljob="1">71</td>
            <td _fckxhtmljob="1">P</td>
            <td _fckxhtmljob="1">80</td>
            <td _fckxhtmljob="1">Y</td>
            <td _fckxhtmljob="1">89</td>
            <td _fckxhtmljob="1">7</td>
            <td _fckxhtmljob="1">55</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">H</td>
            <td _fckxhtmljob="1">72</td>
            <td _fckxhtmljob="1">Q</td>
            <td _fckxhtmljob="1">81</td>
            <td _fckxhtmljob="1">Z</td>
            <td _fckxhtmljob="1">90</td>
            <td _fckxhtmljob="1">8</td>
            <td _fckxhtmljob="1">56</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">I</td>
            <td _fckxhtmljob="1">73</td>
            <td _fckxhtmljob="1">R</td>
            <td _fckxhtmljob="1">82</td>
            <td _fckxhtmljob="1">0</td>
            <td _fckxhtmljob="1">48</td>
            <td _fckxhtmljob="1">9</td>
            <td _fckxhtmljob="1">57</td>
        </tr>
    </tbody>
</table>
<p _fckxhtmljob="1">　　&nbsp;</p>
<p _fckxhtmljob="1">
<table class=" FCK__ShowTableBorders" cellSpacing=1 cellPadding=1 width="100%" bgColor=#999999 border=0 _fckxhtmljob="1">
    <tbody _fckxhtmljob="1">
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td colSpan=4 _fckxhtmljob="1"><strong _fckxhtmljob="1">数字键盘上的键的键码值(keyCode)</strong></td>
            <td colSpan=4 _fckxhtmljob="1"><strong _fckxhtmljob="1">功能键键码值(keyCode)</strong></td>
        </tr>
        <tr align=middle bgColor=#dddddd _fckxhtmljob="1">
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">0</td>
            <td _fckxhtmljob="1">96</td>
            <td _fckxhtmljob="1">8</td>
            <td _fckxhtmljob="1">104</td>
            <td _fckxhtmljob="1">F1</td>
            <td _fckxhtmljob="1">112</td>
            <td _fckxhtmljob="1">F7</td>
            <td _fckxhtmljob="1">118</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">1</td>
            <td _fckxhtmljob="1">97</td>
            <td _fckxhtmljob="1">9</td>
            <td _fckxhtmljob="1">105</td>
            <td _fckxhtmljob="1">F2</td>
            <td _fckxhtmljob="1">113</td>
            <td _fckxhtmljob="1">F8</td>
            <td _fckxhtmljob="1">119</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">2</td>
            <td _fckxhtmljob="1">98</td>
            <td _fckxhtmljob="1">*</td>
            <td _fckxhtmljob="1">106</td>
            <td _fckxhtmljob="1">F3</td>
            <td _fckxhtmljob="1">114</td>
            <td _fckxhtmljob="1">F9</td>
            <td _fckxhtmljob="1">120</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">3</td>
            <td _fckxhtmljob="1">99</td>
            <td _fckxhtmljob="1">+</td>
            <td _fckxhtmljob="1">107</td>
            <td _fckxhtmljob="1">F4</td>
            <td _fckxhtmljob="1">115</td>
            <td _fckxhtmljob="1">F10</td>
            <td _fckxhtmljob="1">121</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">4</td>
            <td _fckxhtmljob="1">100</td>
            <td _fckxhtmljob="1">Enter</td>
            <td _fckxhtmljob="1">108</td>
            <td _fckxhtmljob="1">F5</td>
            <td _fckxhtmljob="1">116</td>
            <td _fckxhtmljob="1">F11</td>
            <td _fckxhtmljob="1">122</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">5</td>
            <td _fckxhtmljob="1">101</td>
            <td _fckxhtmljob="1">-</td>
            <td _fckxhtmljob="1">109</td>
            <td _fckxhtmljob="1">F6</td>
            <td _fckxhtmljob="1">117</td>
            <td _fckxhtmljob="1">F12</td>
            <td _fckxhtmljob="1">123</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">6</td>
            <td _fckxhtmljob="1">102</td>
            <td _fckxhtmljob="1">.</td>
            <td _fckxhtmljob="1">110</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">7</td>
            <td _fckxhtmljob="1">103</td>
            <td _fckxhtmljob="1">/</td>
            <td _fckxhtmljob="1">111</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
        </tr>
    </tbody>
</table>
</p>
<p _fckxhtmljob="1">　　&nbsp;</p>
<p _fckxhtmljob="1">
<table class=" FCK__ShowTableBorders" cellSpacing=1 cellPadding=1 width="100%" bgColor=#999999 border=0 _fckxhtmljob="1">
    <tbody _fckxhtmljob="1">
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td colSpan=8 _fckxhtmljob="1"><strong _fckxhtmljob="1">控制键键码值(keyCode)</strong></td>
        </tr>
        <tr align=middle bgColor=#dddddd _fckxhtmljob="1">
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">BackSpace</td>
            <td _fckxhtmljob="1">8</td>
            <td _fckxhtmljob="1">Esc</td>
            <td _fckxhtmljob="1">27</td>
            <td _fckxhtmljob="1">Right Arrow</td>
            <td _fckxhtmljob="1">39</td>
            <td _fckxhtmljob="1">-_</td>
            <td _fckxhtmljob="1">189</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">Tab</td>
            <td _fckxhtmljob="1">9</td>
            <td _fckxhtmljob="1">Spacebar</td>
            <td _fckxhtmljob="1">32</td>
            <td _fckxhtmljob="1">Dw Arrow</td>
            <td _fckxhtmljob="1">40</td>
            <td _fckxhtmljob="1">.&gt;</td>
            <td _fckxhtmljob="1">190</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">Clear</td>
            <td _fckxhtmljob="1">12</td>
            <td _fckxhtmljob="1">Page Up</td>
            <td _fckxhtmljob="1">33</td>
            <td _fckxhtmljob="1">Insert</td>
            <td _fckxhtmljob="1">45</td>
            <td _fckxhtmljob="1">/?</td>
            <td _fckxhtmljob="1">191</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">Enter</td>
            <td _fckxhtmljob="1">13</td>
            <td _fckxhtmljob="1">Page Down</td>
            <td _fckxhtmljob="1">34</td>
            <td _fckxhtmljob="1">Delete</td>
            <td _fckxhtmljob="1">46</td>
            <td _fckxhtmljob="1">`~</td>
            <td _fckxhtmljob="1">192</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">Shift</td>
            <td _fckxhtmljob="1">16</td>
            <td _fckxhtmljob="1">End</td>
            <td _fckxhtmljob="1">35</td>
            <td _fckxhtmljob="1">Num Lock</td>
            <td _fckxhtmljob="1">144</td>
            <td _fckxhtmljob="1">[{</td>
            <td _fckxhtmljob="1">219</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">Control</td>
            <td _fckxhtmljob="1">17</td>
            <td _fckxhtmljob="1">Home</td>
            <td _fckxhtmljob="1">36</td>
            <td _fckxhtmljob="1">;:</td>
            <td _fckxhtmljob="1">186</td>
            <td _fckxhtmljob="1">\|</td>
            <td _fckxhtmljob="1">220</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">Alt</td>
            <td _fckxhtmljob="1">18</td>
            <td _fckxhtmljob="1">Left Arrow</td>
            <td _fckxhtmljob="1">37</td>
            <td _fckxhtmljob="1">=+</td>
            <td _fckxhtmljob="1">187</td>
            <td _fckxhtmljob="1">]}</td>
            <td _fckxhtmljob="1">221</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">Cape Lock</td>
            <td _fckxhtmljob="1">20</td>
            <td _fckxhtmljob="1">Up Arrow</td>
            <td _fckxhtmljob="1">38</td>
            <td _fckxhtmljob="1">,&lt;</td>
            <td _fckxhtmljob="1">188</td>
            <td _fckxhtmljob="1">'"</td>
            <td _fckxhtmljob="1">222</td>
        </tr>
    </tbody>
</table>
</p>
<p _fckxhtmljob="1">
<table class=" FCK__ShowTableBorders" cellSpacing=1 cellPadding=1 width="100%" bgColor=#999999 border=0 _fckxhtmljob="1">
    <tbody _fckxhtmljob="1">
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td colSpan=8 _fckxhtmljob="1"><strong _fckxhtmljob="1">多媒体键码值(keyCode)</strong></td>
        </tr>
        <tr align=middle bgColor=#dddddd _fckxhtmljob="1">
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
            <td width="10%" _fckxhtmljob="1">按键</td>
            <td width="10%" _fckxhtmljob="1">键码</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">音量加</td>
            <td _fckxhtmljob="1">175</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">音量减</td>
            <td _fckxhtmljob="1">174</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">停止</td>
            <td _fckxhtmljob="1">179</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">静音</td>
            <td _fckxhtmljob="1">173</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">浏览器</td>
            <td _fckxhtmljob="1">172</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">邮件</td>
            <td _fckxhtmljob="1">180</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">搜索</td>
            <td _fckxhtmljob="1">170</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
        </tr>
        <tr align=middle bgColor=#ffffff _fckxhtmljob="1">
            <td _fckxhtmljob="1">收藏</td>
            <td _fckxhtmljob="1">171</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
            <td _fckxhtmljob="1">&nbsp;</td>
        </tr>
    </tbody>
</table>
</p>
<img src ="http://www.phpweblog.net/kiyone/aggbug/1138.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-04-19 21:10 <a href="http://www.phpweblog.net/kiyone/archive/2007/04/19/1138.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>javascript的onkeyUp方法</title><link>http://www.phpweblog.net/kiyone/archive/2007/04/19/1137.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Thu, 19 Apr 2007 12:50:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/04/19/1137.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/1137.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/04/19/1137.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/1137.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/1137.html</trackback:ping><description><![CDATA[<p>功能：在往第一个文本框或第二个文本框里输入的时候，同时在第三个文本框里显示输入的内容。<br>问题：在首次载入的时候，输入拼音，功能能实现。但是输入汉字，功能不能实现。必须在第一次<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 输入后，将输入内容删除，再重新输入，功能才能实现。</p>
<p>&lt;html&gt;<br>&lt;head&gt;&lt;/head&gt;<br>&lt;script language="JavaScript"&gt;<br>&nbsp;&nbsp; function addStr(elem1, elem2, des) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var newStr1 = elem1.value;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var newStr2 = document.getElementById(elem2).value;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.getElementById(des).value=newStr1 + newStr2;<br>&nbsp;&nbsp; }<br>&lt;/script&gt;<br>&lt;body&gt;<br>&lt;input type="text" name="str1" value="" onkeyUp="addStr(this, 'str2', 'str3')" &gt;<br>&lt;br&gt;<br>&lt;input type="text" name="str2" value="" onkeyUp="addStr(this, 'str1', 'str3')" &gt;<br>&lt;br&gt;<br>&lt;input type="text" name="str3" value="" &gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</p>
<img src ="http://www.phpweblog.net/kiyone/aggbug/1137.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-04-19 20:50 <a href="http://www.phpweblog.net/kiyone/archive/2007/04/19/1137.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>链接提示文字的实现</title><link>http://www.phpweblog.net/kiyone/archive/2007/04/19/1136.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Thu, 19 Apr 2007 12:49:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/04/19/1136.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/1136.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/04/19/1136.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/1136.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/1136.html</trackback:ping><description><![CDATA[<p>在Web中经常碰到链接提示文字效果,就是当鼠标经过URL链接时,立刻<a name=baidusnap0></a><strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">弹出</strong>一个<a name=baidusnap1></a><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">提示层</strong>(DIV),提示链接内容等等相关文字.虽然知道是用隐藏DIV实现的,不过一直不知道怎么弄.昨天搜到一个JS文件,可以轻松搞定.帖出来,收藏一下.<br>JS文件代码如下(mouse_on_title.js):</p>
<p>&nbsp;</p>
<p>&lt;!--<br>//***********默认设置定义.*********************<br>tPopWait=50;&nbsp;&nbsp;//停留tWait豪秒后显示提示。<br>tPopShow=6000;&nbsp;&nbsp;//显示tShow豪秒后关闭提示<br>showPopStep=20;<br>popOpacity=95;<br>fontcolor="#000000";<br>bgcolor="#EDEDED";<br>bordercolor="#007db5";</p>
<p>//***************内部变量定义*****************<br>sPop=null;curShow=null;tFadeOut=null;tFadeIn=null;tFadeWaiting=null;</p>
<p>document.write("&lt;style type='text/css'id='defaultPopStyle'&gt;");<br>document.write(".cPopText {&nbsp; background-color: " + bgcolor + ";color:" + fontcolor + "; border: 1px " + bordercolor + " solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");<br>document.write("&lt;/style&gt;");<br>document.write("&lt;div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'&gt;&lt;/div&gt;");</p>
<p><br>function showPopupText(){<br>var o=event.srcElement;<br>&nbsp;MouseX=event.x;<br>&nbsp;MouseY=event.y;<br>&nbsp;if(o.alt!=null &amp;&amp; o.alt!=""){o.dypop=o.alt;o.alt=""};<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(o.title!=null &amp;&amp; o.title!=""){o.dypop=o.title;o.title=""};<br>&nbsp;if(o.dypop!=sPop) {<br>&nbsp;&nbsp;&nbsp;sPop=o.dypop;<br>&nbsp;&nbsp;&nbsp;clearTimeout(curShow);<br>&nbsp;&nbsp;&nbsp;clearTimeout(tFadeOut);<br>&nbsp;&nbsp;&nbsp;clearTimeout(tFadeIn);<br>&nbsp;&nbsp;&nbsp;clearTimeout(tFadeWaiting);&nbsp;<br>&nbsp;&nbsp;&nbsp;if(sPop==null || sPop=="") {<br>&nbsp;&nbsp;&nbsp;&nbsp;dypopLayer.innerHTML="";<br>&nbsp;&nbsp;&nbsp;&nbsp;dypopLayer.style.filter="Alpha()";<br>&nbsp;&nbsp;&nbsp;&nbsp;dypopLayer.filters.Alpha.opacity=0;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;else {<br>&nbsp;&nbsp;&nbsp;&nbsp;if(o.dyclass!=null) popStyle=o.dyclass <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else popStyle="cPopText";<br>&nbsp;&nbsp;&nbsp;&nbsp;curShow=setTimeout("showIt()",tPopWait);<br>&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;}<br>}</p>
<p>function showIt(){<br>&nbsp;&nbsp;dypopLayer.className=popStyle;<br>&nbsp;&nbsp;dypopLayer.innerHTML=sPop;<br>&nbsp;&nbsp;popWidth=dypopLayer.clientWidth;<br>&nbsp;&nbsp;popHeight=dypopLayer.clientHeight;<br>&nbsp;&nbsp;if(MouseX+12+popWidth&gt;document.body.clientWidth) popLeftAdjust=-popWidth-24<br>&nbsp;&nbsp;&nbsp;else popLeftAdjust=0;<br>&nbsp;&nbsp;if(MouseY+12+popHeight&gt;document.body.clientHeight) popTopAdjust=-popHeight-24<br>&nbsp;&nbsp;&nbsp;else popTopAdjust=0;<br>&nbsp;&nbsp;dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;<br>&nbsp;&nbsp;dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;<br>&nbsp;&nbsp;dypopLayer.style.filter="Alpha(Opacity=0)";<br>&nbsp;&nbsp;fadeOut();<br>}</p>
<p>function fadeOut(){<br>&nbsp;if(dypopLayer.filters.Alpha.opacity&lt;popOpacity) {<br>&nbsp;&nbsp;dypopLayer.filters.Alpha.opacity+=showPopStep;<br>&nbsp;&nbsp;tFadeOut=setTimeout("fadeOut()",1);<br>&nbsp;&nbsp;}<br>&nbsp;&nbsp;else {<br>&nbsp;&nbsp;&nbsp;dypopLayer.filters.Alpha.opacity=popOpacity;<br>&nbsp;&nbsp;&nbsp;tFadeWaiting=setTimeout("fadeIn()",tPopShow);<br>&nbsp;&nbsp;&nbsp;}<br>}</p>
<p>function fadeIn(){<br>&nbsp;if(dypopLayer.filters.Alpha.opacity&gt;0) {<br>&nbsp;&nbsp;dypopLayer.filters.Alpha.opacity-=1;<br>&nbsp;&nbsp;tFadeIn=setTimeout("fadeIn()",1);<br>&nbsp;&nbsp;}<br>}<br>document.onmouseover=showPopupText;<br>--&gt;<br><br>应用的时候,在页面的&lt;head&gt;&lt;/head&gt;之间加入:<br>&lt;SCRIPT language=javascript src="mouse_on_title.js"&gt;&lt;/SCRIPT&gt;<br><br>在需要<strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">提示层</strong>的链接中加入title属性,比如:<br>//&lt;a href=&#8221;目标&#8221; title=&#8221;提示文字内容&#8221;&gt;测试&lt;/a&gt;<br>其实如果不加上述JS文件,<strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">提示层</strong>效果也是可以出来的.就是速度比较慢,<strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">提示层</strong>效果比较单调而已.</p>
<img src ="http://www.phpweblog.net/kiyone/aggbug/1136.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-04-19 20:49 <a href="http://www.phpweblog.net/kiyone/archive/2007/04/19/1136.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Js字符串操作函数大全</title><link>http://www.phpweblog.net/kiyone/archive/2007/04/19/1135.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Thu, 19 Apr 2007 12:45:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/04/19/1135.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/1135.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/04/19/1135.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/1135.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/1135.html</trackback:ping><description><![CDATA[<p>Js字符串操作函数大全</p>
<p>/*<br>******************************************<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;&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; <br>******************************************<br>*/</p>
<p>/*<br>===========================================<br>//去除左边的空格<br>===========================================</p>
<p>*/<br>String.prototype.LTrim = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.replace(/(^\s*)/g, "");<br>}</p>
<p><br>/*<br>===========================================<br>//去除右边的空格<br>===========================================<br>*/<br>String.prototype.Rtrim = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.replace(/(\s*$)/g, "");<br>}</p>
<p>&nbsp;</p>
<p>/*<br>===========================================<br>//去除前后空格<br>===========================================<br>*/<br>String.prototype.Trim = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.replace(/(^\s*)|(\s*$)/g, "");<br>}</p>
<p>/*<br>===========================================<br>//得到左边的字符串<br>===========================================<br>*/<br>String.prototype.Left = function(len)<br>{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(isNaN(len)||len==null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; len = this.length;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(parseInt(len)&lt;0||parseInt(len)&gt;this.length)<br>&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; len = this.length;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.substr(0,len);<br>}</p>
<p><br>/*<br>===========================================<br>//得到右边的字符串<br>===========================================<br>*/<br>String.prototype.Right = function(len)<br>{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(isNaN(len)||len==null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; len = this.length;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(parseInt(len)&lt;0||parseInt(len)&gt;this.length)<br>&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; len = this.length;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.substring(this.length-len,this.length);<br>}</p>
<p><br>/*<br>===========================================<br>//得到中间的字符串,注意从0开始<br>===========================================<br>*/<br>String.prototype.Mid = function(start,len)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.substr(start,len);<br>}</p>
<p><br>/*<br>===========================================<br>//在字符串里查找另一字符串:位置从0开始<br>===========================================<br>*/<br>String.prototype.InStr = function(str)<br>{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(str==null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str = "";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.indexOf(str);<br>}</p>
<p>/*<br>===========================================<br>//在字符串里反向查找另一字符串:位置0开始<br>===========================================<br>*/<br>String.prototype.InStrRev = function(str)<br>{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(str==null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str = "";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.lastIndexOf(str);<br>}</p>
<p>&nbsp;</p>
<p>/*<br>===========================================<br>//计算字符串打印长度<br>===========================================<br>*/<br>String.prototype.LengthW = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.replace(/[^\x00-\xff]/g,"**").length;<br>}</p>
<p>/*<br>===========================================<br>//是否是正确的IP地址<br>===========================================<br>*/<br>String.prototype.isIP = function()<br>{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var reSpaceCheck = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (reSpaceCheck.test(this))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.match(reSpaceCheck);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (RegExp.$1 &lt;= 255 &amp;&amp; RegExp.$1 &gt;= 0 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;&amp; RegExp.$2 &lt;= 255 &amp;&amp; RegExp.$2 &gt;= 0 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;&amp; RegExp.$3 &lt;= 255 &amp;&amp; RegExp.$3 &gt;= 0 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;&amp; RegExp.$4 &lt;= 255 &amp;&amp; RegExp.$4 &gt;= 0) <br>&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; return true;&nbsp;&nbsp;&nbsp;&nbsp; <br>&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; else<br>&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; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp; <br>}</p>
<p><br>/*<br>===========================================<br>//是否是正确的长日期<br>===========================================<br>*/<br>String.prototype.isLongDate = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var r = this.replace(/(^\s*)|(\s*$)/g, "").match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(r==null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var d = new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return (d.getFullYear()==r[1]&amp;&amp;(d.getMonth()+1)==r[3]&amp;&amp;d.getDate()==r[4]&amp;&amp;d.getHours()==r[5]&amp;&amp;d.getMinutes()==r[6]&amp;&amp;d.getSeconds()==r[7]);</p>
<p>}</p>
<p>/*<br>===========================================<br>//是否是正确的短日期<br>===========================================<br>*/<br>String.prototype.isShortDate = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var r = this.replace(/(^\s*)|(\s*$)/g, "").match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(r==null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var d = new Date(r[1], r[3]-1, r[4]); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return (d.getFullYear()==r[1]&amp;&amp;(d.getMonth()+1)==r[3]&amp;&amp;d.getDate()==r[4]);<br>}</p>
<p>/*<br>===========================================<br>//是否是正确的日期<br>===========================================<br>*/<br>String.prototype.isDate = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.isLongDate()||this.isShortDate();<br>}</p>
<p>/*<br>===========================================<br>//是否是手机<br>===========================================<br>*/<br>String.prototype.isMobile = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return /^0{0,1}13[0-9]{9}$/.test(this);<br>}</p>
<p>/*<br>===========================================<br>//是否是邮件<br>===========================================<br>*/<br>String.prototype.isEmail = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(this);<br>}</p>
<p>/*<br>===========================================<br>//是否是邮编(中国)<br>===========================================<br>*/</p>
<p>String.prototype.isZipCode = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return /^[\\d]{6}$/.test(this);<br>}</p>
<p>/*<br>===========================================<br>//是否是有汉字<br>===========================================<br>*/<br>String.prototype.existChinese = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //[\u4E00-\u9FA5]為漢字﹐[\uFE30-\uFFA0]為全角符號<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return /^[\x00-\xff]*$/.test(this);<br>}</p>
<p>/*<br>===========================================<br>//是否是合法的文件名/目录名<br>===========================================<br>*/<br>String.prototype.isFileName = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return !/[\\\/\*\?\|:"&lt;&gt;]/g.test(this);<br>}</p>
<p>/*<br>===========================================<br>//是否是有效链接<br>===========================================<br>*/<br>String.prototype.isUrl = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return /^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&amp;=]*)?$/i.test(this);<br>}</p>
<p><br>/*<br>===========================================<br>//是否是有效的身份证(中国)<br>===========================================<br>*/<br>String.prototype.isIDCard = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var iSum=0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var info="";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var sId = this;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var aCity={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"};</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!/^\d{17}(\d|x)$/i.test(sId))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sId=sId.replace(/x$/i,"a");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //非法地区<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(aCity[parseInt(sId.substr(0,2))]==null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var sBirthday=sId.substr(6,4)+"-"+Number(sId.substr(10,2))+"-"+Number(sId.substr(12,2));</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var d=new Date(sBirthday.replace(/-/g,"/"))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //非法生日<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(sBirthday!=(d.getFullYear()+"-"+ (d.getMonth()+1) + "-" + d.getDate()))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(var i = 17;i&gt;=0;i--) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iSum += (Math.pow(2,i) % 11) * parseInt(sId.charAt(17 - i),11);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(iSum%11!=1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;</p>
<p>}</p>
<p>/*<br>===========================================<br>//是否是有效的电话号码(中国)<br>===========================================<br>*/<br>String.prototype.isPhoneCall = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return /(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/.test(this);<br>}</p>
<p><br>/*<br>===========================================<br>//是否是数字<br>===========================================<br>*/<br>String.prototype.isNumeric = function(flag)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //验证是否是数字<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(isNaN(this))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch(flag)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case null:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //数字<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "":<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "+":&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; return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /(^\+?|^\d?)\d*\.?\d+$/.test(this);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "-":&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; return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /^-\d*\.?\d+$/.test(this);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "i":&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; return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /(^-?|^\+?|\d)\d+$/.test(this);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "+i":&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; return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /(^\d+$)|(^\+?\d+$)/.test(this);&nbsp;&nbsp;&nbsp;&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; case "-i":&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; return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /^[-]\d+$/.test(this);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "f":&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; return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /(^-?|^\+?|^\d?)\d*\.\d+$/.test(this);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "+f":&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; return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /(^\+?|^\d?)\d*\.\d+$/.test(this);&nbsp;&nbsp;&nbsp;&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; case "-f":&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; return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /^[-]\d*\.\d$/.test(this);&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; default:&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; return true;&nbsp;&nbsp;&nbsp;&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; }<br>}</p>
<p>/*<br>===========================================<br>//是否是颜色(#FFFFFF形式)<br>===========================================<br>*/<br>String.prototype.IsColor = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var temp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = this;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (temp=="") return true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (temp.length!=7) return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return (temp.search(/\#[a-fA-F0-9]{6}/) != -1);<br>}</p>
<p>/*<br>===========================================<br>//转换成全角<br>===========================================<br>*/<br>String.prototype.toCase = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var tmp = "";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(var i=0;i&lt;this.length;i++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(this.charCodeAt(i)&gt;0&amp;&amp;this.charCodeAt(i)&lt;255)<br>&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; tmp += String.fromCharCode(this.charCodeAt(i)+65248);<br>&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; else<br>&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; tmp += String.fromCharCode(this.charCodeAt(i));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return tmp<br>}</p>
<p>/*<br>===========================================<br>//对字符串进行Html编码<br>===========================================<br>*/<br>String.prototype.toHtmlEncode = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var str = this;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str=str.replace(/&amp;/g,"&amp;amp;");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str=str.replace(/&lt;/g,"&amp;lt;");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str=str.replace(/&gt;/g,"&amp;gt;");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str=str.replace(/\'/g,"&amp;apos;");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str=str.replace(/\"/g,"&amp;quot;");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str=str.replace(/\n/g,"&lt;br&gt;");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str=str.replace(/\ /g,"&amp;nbsp;");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str=str.replace(/\t/g,"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return str;<br>}</p>
<p>/*<br>===========================================<br>//转换成日期<br>===========================================<br>*/<br>String.prototype.toDate = function()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new Date(this.replace(/-/g, "\/"));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch(e)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return null;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>}</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>1.Asc(x),Chr(x):转换字符，字符码</p>
<p>2。Filter:搜寻字符串数组中的特定字符串</p>
<p>格式：v=filter(x,s[,include[,compare]])</p>
<p>实例：</p>
<p>Dim x()={"kjwang","wangkj","peter"}</p>
<p>Dim v</p>
<p>v=filter(x,"kj") '结果v(0)="kjwang",v(1)="wangkj"</p>
<p>v=filter(x,"kj",false) '结果v(0)="peter"</p>
<p>v=filter(x,"kj",true,vbTextCompare) '不分大小写搜寻 </p>
<p>3.InStr:寻找字符串位置(InstrRev:倒过来寻找字符串）</p>
<p>格式：</p>
<p>v=instr(x,y) '从x字符串第1个字符起找出y字符串出现的位置</p>
<p>v=instr(n,x,y) '从x字符串第n个字符起找出y字符串出现的位置</p>
<p>格式：</p>
<p>v=InstrRev(x,s[,n[,Compare]])</p>
<p>4。Join:将字符串连接</p>
<p>格式：v=join(x[,d]）&#8217;d为分隔字符</p>
<p>5。Len(x):计算字符串x的长度</p>
<p>格式：v=len(x)</p>
<p>6.Left(x,n):返回字符串x左边n个字符(对应Right(x,n))</p>
<p>7。Mid:读取字符串x中间的字符</p>
<p>格式：v=mid(x,n,m)</p>
<p>8。LTrim(x),RTim(x),Trim(x)去空白字符</p>
<p>9.Replace:字符串取代</p>
<p>格式：v=Replace(x,s,r)</p>
<p>实例：x="i saw a saw a saw"</p>
<p>v=replace(x,"saw","so") 'v="i so a so a so"</p>
<p>10.Split:字符串分割</p>
<p>格式：v=split(s[,d])</p>
<p>实例：v=split("vb.net,iis6.0,asp.net",",")</p>
<p>'结果v(0)="vb.net",v(1)="iis6.0",v(2)="asp.net"</p>
<p>11.StrReverse:反转字符串</p>
<p>实例：v=strreverse("kjwang") 'v="gnawjk"</p>
<p>12.UCase(x),LCase(x):变换英文字母的大小写</p>
<p>实例：x="hello,VB中文!"</p>
<p>v=UCase(x) 'v="HELLO,VB中文！" <br>1.取出日期时间</p>
<p>－1）DateValue(x),TimeValue(x)</p>
<p>格式：v=DateValue(x) :取出的&#8220;日期&#8221;部分</p>
<p>　　　v=timevalue(x) '类上</p>
<p>－2）Year(x),Month(x),Day(x)</p>
<p>格式：v=Year(x)</p>
<p>　　　v=Month(x)</p>
<p>　　　v=Day(x)</p>
<p>　　　Hour(x),Minute(x),Second(x):取出时，分，秒</p>
<p>－3）DateSerial(Y,M,D):合并年、月、日成为日期</p>
<p>实例：Dim v</p>
<p>v=DateSerial(1996,10,5) 'v=1996/10/5</p>
<p>　　　TimeSerial(H,M,S):合并时、分、秒成为时间</p>
<p>2.Now:读取系统日期时间</p>
<p>格式：v=now</p>
<p>3.Timer:从凌晨12：00：00AM起所经过的秒数</p>
<p>格式：v=timer</p>
<p>4.DatePart(p,x):取出年、月、日等各部分的数值</p>
<p>实例：Dim X=#2/10/1996 16:45:30#</p>
<p>v=DatePart("yyyy",X) 'v=1996年</p>
<p>v=DatePart("m",X) 'v=2月</p>
<p>v=DatePart("d",X) 'v=10日</p>
<p>v=DatePart("h",X) 'v=16时</p>
<p>v=DatePart("n",X) 'v=45分</p>
<p>v=DatePart("s",X) 'v=30秒</p>
<p>v=DatePart("q",X) 'v=1季（第一季，春季）</p>
<p>v=DatePart("y",X) 'v=41天（1996年的第41天）</p>
<p>v=DatePart("ww",X) 'v=6周（1996年的第6周）</p>
<p>v=DatePart("w",X) 'v=7（第6周的第7天，即星期六）</p>
<p>5。DateAdd(p,n,x):加减若干时间后的新日期时间</p>
<p>格式：v=DateAdd(p,n,x) 'p值同上如："yyyy"、"m"等</p>
<p>实例：Dim x=#1/31/1996 16:45:30#</p>
<p>v=dateadd("yyyy",-3,x) '减3年，v=1993/1/31 16:45:30</p>
<p>6.DateDiff(p,x1,x2):计算两日期时间的差值 'p值同上</p>
<p>实例：dim x1=#12/31/1996 16:45:30#</p>
<p>x2=#2/10/1997 9:30:50#</p>
<p>v=datediff("yyyy",x1,x2) 'v=1年 </p>
<p>7。FormatDateTime:日期时间的格式化</p>
<p>格式：v=formatdateyime(x[,日期格式])</p>
<p>日期格式值：DateFormat.GeneralDate　、　DateFormat.LongDate、</p>
<p>DateFotmat.ShortDate、DateFormat.LongTime、DateFormat.ShortTime</p>
<p>8.MonthName:返回月份名称</p>
<p>实例：v=monthname(5) 'v="五月"</p>
<p>9.WeekDayName:返回星期名称　&#8217;用法同8.</p>
<img src ="http://www.phpweblog.net/kiyone/aggbug/1135.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-04-19 20:45 <a href="http://www.phpweblog.net/kiyone/archive/2007/04/19/1135.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>经常用到的javaScript技术代码</title><link>http://www.phpweblog.net/kiyone/archive/2007/03/16/1003.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Fri, 16 Mar 2007 10:24:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/03/16/1003.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/1003.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/03/16/1003.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/1003.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/1003.html</trackback:ping><description><![CDATA[
		<h3>一、验证类<br /></h3>1、数字验证内<br />1.1 整数<br />1.2 大于0的整数 （用于传来的ID的验证)<br />1.3 负整数的验证<br />1.4 整数不能大于iMax<br />1.5 整数不能小于iMin<br />2、时间类<br />2.1 短时间，形如 (13:04:06)<br />2.2 短日期，形如 (2003-12-05)<br />2.3 长时间，形如 (2003-12-05 13:04:06)<br />2.4 只有年和月。形如(2003-05,或者2003-5)<br />2.5 只有小时和分钟,形如(12:03)<br />3、表单类<br />3.1 所有的表单的值都不能为空<br />3.2 多行文本框的值不能为空。<br />3.3 多行文本框的值不能超过sMaxStrleng<br />3.4 多行文本框的值不能少于sMixStrleng<br />3.5 判断单选框是否选择。<br />3.6 判断复选框是否选择.<br />3.7 复选框的全选，多选，全不选，反选<br />3.8 文件上传过程中判断文件类型<br />4、字符类<br />4.1 判断字符全部由a-Z或者是A-Z的字字母组成<br />4.2 判断字符由字母和数字组成。<br />4.3 判断字符由字母和数字，下划线,点号组成.且开头的只能是下划线和字母<br />4.4 字符串替换函数.Replace();<br />5、浏览器类<br />5.1 判断浏览器的类型<br />5.2 判断ie的版本<br />5.3 判断客户端的分辨率 
<p>6、结合类<br />6.1 email的判断。<br />6.2 手机号码的验证<br />6.3 身份证的验证</p><p><br />二、功能类</p><p>1、时间与相关控件类<br />1.1 日历<br />1.2 时间控件<br />1.3 万年历<br />1.4 显示动态显示时钟效果（文本，如OA中时间）<br />1.5 显示动态显示时钟效果 (图像，像手表) <br />2、表单类<br />2.1 自动生成表单<br />2.2 动态添加，修改，删除下拉框中的元素<br />2.3 可以输入内容的下拉框<br />2.4 多行文本框中只能输入iMax文字。如果多输入了，自动减少到iMax个文字（多用于短信发送)</p><p>3、打印类<br />3.1 打印控件<br />4、事件类<br />4.1 屏蔽右键<br />4.2 屏蔽所有功能键<br />4.3 --&gt; 和&lt;-- F5 F11,F9,F1<br />4.4 屏蔽组合键ctrl+N<br />5、网页设计类<br />5.1 连续滚动的文字，图片（注意是连续的，两段文字和图片中没有空白出现）<br />5.2 html编辑控件类<br />5.3 颜色选取框控件<br />5.4 下拉菜单<br />5.5 两层或多层次的下拉菜单<br />5.6 仿IE菜单的按钮。（效果如rongshuxa.com的导航栏目)<br />5.7 状态栏，title栏的动态效果（例子很多，可以研究一下）<br />5.8 双击后，网页自动滚屏<br />6、树型结构。<br />6.1 asp+SQL版<br />6.2 asp+xml+sql版<br />6.3 java+sql或者java+sql+xml<br />7、无边框效果的制作<br />8、连动下拉框技术<br />9、文本排序<br />---------------------------------------------------------------------------------------</p><p>一、验证类<br />1、数字验证内<br />1.1 整数<br />/^(-|\+)?\d+$/.test(str)<br />1.2 大于0的整数 （用于传来的ID的验证)<br />/^\d+$/.test(str)<br />1.3 负整数的验证<br />/^-\d+$/.test(str)<br />2、时间类<br />2.1 短时间，形如 (13:04:06)<br />function isTime(str)<br />{<br />var a = str.match(/^(\d{1,2})(?(\d{1,2})\2(\d{1,2})$/);<br />if (a == null) {alert('输入的参数不是时间格式'); return false;}<br />if (a[1]&gt;24 || a[3]&gt;60 || a[4]&gt;60)<br />{<br />alert("时间格式不对");<br />return false<br />}<br />return true;<br />}<br />2.2 短日期，形如 (2003-12-05)<br />function strDateTime(str)<br />{<br />var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/); <br />if(r==null)return false; <br />var d= new Date(r[1], r[3]-1, r[4]); <br />return (d.getFullYear()==r[1]&amp;&amp;(d.getMonth()+1)==r[3]&amp;&amp;d.getDate()==r[4]);<br />}<br />2.3 长时间，形如 (2003-12-05 13:04:06)<br />function strDateTime(str)<br />{<br />var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2})\d{1,2})\d{1,2})$/; <br />var r = str.match(reg); <br />if(r==null)return false; <br />var d= new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]); <br />return (d.getFullYear()==r[1]&amp;&amp;(d.getMonth()+1)==r[3]&amp;&amp;d.getDate()==r[4]&amp;&amp;d.getHours()==r[5]&amp;&amp;d.getMinutes()==r[6]&amp;&amp;d.getSeconds()==r[7]);<br />}<br />2.4 只有年和月。形如(2003-05,或者2003-5)<br />2.5 只有小时和分钟,形如(12:03)<br />3、表单类<br />3.1 所有的表单的值都不能为空</p><p>3.2 多行文本框的值不能为空。<br />3.3 多行文本框的值不能超过sMaxStrleng<br />3.4 多行文本框的值不能少于sMixStrleng<br />3.5 判断单选框是否选择。<br />3.6 判断复选框是否选择.<br />3.7 复选框的全选，多选，全不选，反选<br />3.8 文件上传过程中判断文件类型<br />4、字符类<br />4.1 判断字符全部由a-Z或者是A-Z的字字母组成</p><p>4.2 判断字符由字母和数字组成。</p><p>4.3 判断字符由字母和数字，下划线,点号组成.且开头的只能是下划线和字母<br />/^([a-zA-z_]{1})([\w]*)$/g.test(str)<br />4.4 字符串替换函数.Replace();<br />5、浏览器类<br />5.1 判断浏览器的类型<br />window.navigator.appName<br />5.2 判断ie的版本<br />window.navigator.appVersion<br />5.3 判断客户端的分辨率<br />window.screen.height; window.screen.width;</p><p>6、结合类<br />6.1 email的判断。<br />function ismail(mail)<br />{<br />return(new RegExp(/^\w+((-\w+)|(\.\w+))*\-AT-[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(mail));<br />}<br />6.2 手机号码的验证<br />6.3 身份证的验证<br />function isIdCardNo(num)<br />{<br />if (isNaN(num)) {alert("输入的不是数字！"); return false;}<br />var len = num.length, re; <br />if (len == 15)<br />re = new RegExp(/^(\d{6})()?(\d{2})(\d{2})(\d{2})(\d{3})$/);<br />else if (len == 18)<br />re = new RegExp(/^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})(\d)$/);<br />else {alert("输入的数字位数不对！"); return false;}<br />var a = num.match(re);<br />if (a != null)<br />{<br />if (len==15)<br />{<br />var D = new Date("19"+a[3]+"/"+a[4]+"/"+a[5]);<br />var B = D.getYear()==a[3]&amp;&amp;(D.getMonth()+1)==a[4]&amp;&amp;D.getDate()==a[5];<br />}<br />else<br />{<br />var D = new Date(a[3]+"/"+a[4]+"/"+a[5]);<br />var B = D.getFullYear()==a[3]&amp;&amp;(D.getMonth()+1)==a[4]&amp;&amp;D.getDate()==a[5];<br />}<br />if (!B) {alert("输入的身份证号 "+ a[0] +" 里出生日期不对！"); return false;}<br />}<br />return true;<br />}<br /><br /></p><p>3.7 复选框的全选，多选，全不选，反选</p><p>全选<br /><br /></p><p>function checkAll(str)<br />{<br />var a = document.getElementsByName(str);<br />var n = a.length;<br />for (var i=0; ia[i].checked = window.event.srcElement.checked;<br />}<br />function checkItem(str)<br />{<br />var e = window.event.srcElement;<br />var all = eval("document.hrong."+ str);<br />if (e.checked)<br />{<br />var a = document.getElementsByName(e.name);<br />all.checked = true;<br />for (var i=0; i{<br />if (!a[i].checked){ all.checked = false; break;}<br />}<br />}<br />else all.checked = false;<br />}</p><p><br />3.8 文件上传过程中判断文件类型</p><p><br />-------------------------------------------------------------------------------------<br />１．身份证严格验证：</p><p> </p><p>２．验证ＩＰ地址</p><p>function isip(s){<br />var check=function(v){try{return (v&lt;=255 &amp;&amp; v&gt;=0)}catch(x){return false}};<br />var re=s.split(".")<br />return (re.length==4)?(check(re[0]) &amp;&amp; check(re[1]) &amp;&amp; check(re[2]) &amp;&amp; check(re[3])):false<br />}</p><p>var s="202.197.78.129";<br />alert(isip(s))</p><p> </p><p>３．加sp1后还能用的无边框窗口！！</p><p> </p><p> </p><p><br />/*--- Special Thanks For andot ---*/</p><p>/*<br />This following code are designed and writen by Windy_sk <br />You can use it freely, but u must held all the copyright items!<br />/</p><p>/- Thanks For andot Again ---*/</p><p>var CW_width = 400;<br />var CW_height = 300;<br />var CW_top = 100;<br />var CW_left = 100;<br />var CW_url = "/";<br />var New_CW = window.createPopup();<br />var CW_Body = New_CW.document.body;<br />var content = "";<br />var CSStext = "margin:1px;color:black; border:2px outset;border-style:expression(<em>onmouse</em>out=<em>onmouse</em>up=function(){this.style.borderStyle='outset'}, <em>onmouse</em>down=function(){if(event.button!=2)this.style.borderStyle='inset'});background-color:buttonface;width:16px;height:14px;font-size:12px;line-height:11px;cursor:Default;";</p><p>//Build Window<br />include.startDownload(CW_url, function(source){content=source});</p><p>function insert_content(){<br />var temp = "";<br />CW_Body.style.overflow = "hidden";<br />CW_Body.style.backgroundColor = "white";<br />CW_Body.style.border = "solid black 1px";<br />content = content.replace(/]*)&gt;/g,"");<br />temp += "";<br />temp += "";<br />temp += "Chromeless Window For IE6 SP1";<br />temp += "";<br />temp += "?";<br />temp += "0";<br />temp += "1";<br />temp += "x";<br />temp += "";<br />temp += "";<br />temp += content;<br />temp += "</p><p>";<br />temp += "";<br />CW_Body.innerHTML = temp;<br />}</p><p>setTimeout("insert_content()",1000);</p><p>var if_max = true;<br />function show_CW(){<br />window.moveTo(10000, 10000);<br />if(if_max){<br />New_CW.show(CW_top, CW_left, CW_width, CW_height);<br />if(typeof(New_CW.document.all.include)!="undefined"){<br />New_CW.document.all.include.style.width = CW_width;<br />New_CW.document.all.Max.innerText = "1";<br />}</p><p>}else{<br />New_CW.show(0, 0, screen.width, screen.height);<br />New_CW.document.all.include.style.width = screen.width;<br />}<br />}</p><p>window.onfocus = show_CW;<br />window.onresize = show_CW;</p><p>// Move Window<br />var drag_x,drag_y,draging=false</p><p>function drag_move(e){<br />if (draging){<br />New_CW.show(e.screenX-drag_x, e.screenY-drag_y, CW_width, CW_height);<br />return false;<br />}<br />}</p><p>function drag_down(e){<br />if(e.button==2)return;<br />if(New_CW.document.body.offsetWidth==screen.width &amp;&amp; New_CW.document.body.offsetHeight==screen.height)return;<br />drag_x=e.clientX;<br />drag_y=e.clientY;<br />draging=true;<br />e.srcElement.setCapture();<br />}</p><p>function drag_up(e){<br />draging=false;<br />e.srcElement.releaseCapture();<br />if(New_CW.document.body.offsetWidth==screen.width &amp;&amp; New_CW.document.body.offsetHeight==screen.height) return;<br />CW_top = e.screenX-drag_x;<br />CW_left = e.screenY-drag_y;<br />}</p><p><br /> <br />电话号码的验证</p><p>要求：<br />(1)电话号码由数字、"("、")"和"-"构成<br />(2)电话号码为3到8位<br />(3)如果电话号码中包含有区号，那么区号为三位或四位<br />(4)区号用"("、")"或"-"和其他部分隔开<br />(5)移动电话号码为11或12位，如果为12位,那么第一位为0<br />(6)11位移动电话号码的第一位和第二位为"13"<br />(7)12位移动电话号码的第二位和第三位为"13"<br />根据这几条规则，可以与出以下正则表达式：<br />(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)</p><p> </p><p>function PhoneCheck(s) {<br />var str=s;<br />var reg=/(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/<br />alert(reg.test(str));<br />}</p><p> </p><p>--------------------------------------------------------------------------------------</p><p><br />---------------------------------------------------------------------------------</p><p>//检验法人代码<br />function isCorporationCode(s){<br />var patrn=/^(\d){15}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验登录名：只能输入5-20个以字母开头、可带数字、“_”、“.”的字串<br />function isRegisterUserName(s)<br />{<br />var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9._]){4,19}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}<br />//校验用户姓名：只能输入1-30个以字母开头的字串<br />function isTrueName(s)<br />{<br />var patrn=/^[^`~!@#$%^&amp;*()+-=|\\\[\]\{\}:;\'\,.&lt;&gt;/? 0-9]{2,19}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验密码：只能输入6-15个字母、数字<br />function isPasswd(s)<br />{<br />var patrn=/^[a-zA-Z0-9]{6,15}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//检验体重<br />function isAvoirdupois(s)<br />{<br />var patrn=/^[1-9]{1}[0-9]{0,2}$/;<br />var patrn2=/^[1-9]{1}$/;<br />var intPart=s.indexOf('.');<br />var decPart=s.lastIndexOf('.');<br />if (intPart==-1 &amp;&amp; patrn.exec(s) &amp;&amp; eval(s)&gt;=2 &amp;&amp; eval(s)&lt;=200) return true<br />if (intPart!=decPart || intPart==0 || intPart+2!=s.length) return false<br />if (!patrn.exec(s.substring(0,intPart)) || !patrn2.exec(s.substring(decPart+1))) return false<br />if (eval(s)&lt;2 || eval(s)&gt;200) return false<br />return true<br />}</p><p>//校验普通电话、传真号码：可以“+”开头，除数字外，可含有“-”<br />function isTel(s)<br />{<br />var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验手机号码：必须以数字开头，除数字外，可含有“-”<br />function isMobile(s)<br />{<br />var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验地区代码<br />function isAreaCode(s)<br />{<br />var patrn=/^(\d){6}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验邮政编码<br />function isPostalCode(s)<br />{<br />var patrn=/^[1-9]{1}(\d){5}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验搜索关键字<br />function isSearch(s)<br />{<br />var patrn=/^[^`~!@#$%^&amp;*()+=|\\\[\]\{\}:;\'\,.&lt;&gt;/? ]{1}[^`~!@$%^&amp;()+=|\\\[\]\{\}:;\'\,.&lt;&gt;?]{0,19}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验是否为ip地址<br />function isIP(s)<br />{<br />var patrn=/^[0-9.]{1,20}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//检验页码是否正确<br />function isPage(s)<br />{<br />var patrn=/^[1-9]{1}[0-9]{0,2}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//表单输入值错误提示<br />function vErr(o,s){<br />alert(s);<br />if (o) o.focus();<br />return false;<br />}</p><p>//判断单选<br />function chkRadio(o){<br />for (i=0;iif (o[i].checked) return true;<br />}<br />return false;<br />} <br />//====================================表单类================================<br />// 文件上传过程中判断文件类型<br />/*</p><p>/</p><p>//表单的值不能为空<br />function isNull(elem){<br />//var pattern=/^\s+|\s+$/;<br />if(elem.replace(/(^\s+|\s$)/g, "")==""){<br />return false;<br />}else{<br />return true;<br />}<br />}<br />//不能超过imax字符<br />function imax(elem){<br />if(elem.length&gt;imax){<br />return false;<br />}else{<br />return true;<br />}<br />}<br />//不能少于imix字符<br />function imix(elem){<br />if(elem.lengthreturn false;<br />}else{<br />return true;<br />}<br />}<br />//输入为中文判断<br />function isChinese(elem){<br />var pattern=/[^\x00-\xff]/g;<br />if(pattern.test(elem)){<br />//包含中文<br />return false;<br />}else{<br />//不包含中文<br />return true;<br />}<br />}</p><p>/ *********************************************************************************************************************</p><p> </p><p> </p><p> </p><p>.cMenu {<br />FILTER: alpha(opacity=0);BACKGROUND-COLOR: #D6D3CE;BORDER-BOTTOM: #666666 2px solid; BORDER-LEFT: #E4E4E4 2px solid; BORDER-RIGHT: #666666 2px solid; BORDER-TOP: #E4E4E4 2px solid; COLOR: #000000; CURSOR: default; FONT-SIZE: 9pt; color:#000000;FONT-WEIGHT: normal; LINE-HEIGHT: 20px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 110px<br />}<br />.menuitems {<br />font-size:9pt;<br />MARGIN: 2px;<br />PADDING-BOTTOM: 0px;<br />PADDING-LEFT: 15px;<br />PADDING-RIGHT: 3px;<br />PADDING-TOP: 0px;<br />}</p><p> </p><p> </p><p> </p><p>&lt;!--[if IE]&gt;<br /><em>onmouse</em>over=highlightie5()&gt;</p><p>电话号码的验证</p><p>要求：<br />(1)电话号码由数字、"("、")"和"-"构成<br />(2)电话号码为3到8位<br />(3)如果电话号码中包含有区号，那么区号为三位或四位<br />(4)区号用"("、")"或"-"和其他部分隔开<br />(5)移动电话号码为11或12位，如果为12位,那么第一位为0<br />(6)11位移动电话号码的第一位和第二位为"13"<br />(7)12位移动电话号码的第二位和第三位为"13"<br />根据这几条规则，可以与出以下正则表达式：<br />(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)</p><p><br />&lt;script language="<em>javascript</em>"&gt;<br />function PhoneCheck(s) {<br />var str=s;<br />var reg=/(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/<br />alert(reg.test(str));<br />}<br />&lt;/script&gt;<br />&lt;input type=text name="iphone"&gt;<br />&lt;input type=button <em>onclick</em>="PhoneCheck(document.all.iphone.<em>value</em>)" <em>value</em>="Check"&gt;<br />----------------------------------------------------------------------------------------</p><p>&lt;%<br />'********************************************<br />'函数功能：正则表达式校验<br />'参数patrn：要校验的类型<br />' "User" - 用户名<br />' "Truename" - 英文姓名<br />' "Passwd" - 密码<br />' "Tel" - 电话/传真<br />' "Mobil" - 手机<br />' "Date" - 日期（格式：yyyy-mm-dd）<br />' "Email" - 电子邮件<br />' "Postalcode" - 邮政编码<br />' "Search" - 搜索关键字<br />' "Int" - 整数<br />'参数strng：要校验的字串<br />'返回值：校验结果，正确返回true，错误返回false<br />'********************************************<br />Function IsVerify(patrn,strng)<br />strng=Trim(strng)<br />Select Case patrn<br />Case "User" '用户名<br />patrn="^[a-z]{1}([a-z0-9]|[._]){2,19}$"<br />Case "Truename" '英文姓名<br />patrn="^[a-zA-Z]{1,30}$"<br />Case "Passwd" '密码<br />patrn="^(\w){6,20}$"<br />Case "Tel" '电话/传真<br />patrn="^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$"<br />Case "Mobil" '手机<br />patrn="^(\d)+[-]?(\d){6,12}$"<br />Case "Date" '日期（格式：yyyy-mm-dd）<br />patrn="^[12]{1}(\d){3}[-][01]?(\d){1}[-][0123]?(\d){1}$"<br />Case "Email" '电子邮件<br />patrn="^((\w)|[-]|[.])+@(((\w)|[-])+[.])+[a-z]{2,4}$"<br />Case "Postalcode" '邮政编码<br />patrn="^[a-z0-9 ]{3,12}$"<br />Case "Search" '搜索关键字<br />patrn="^[^`~!@#$%^&amp;*()+=|\\\[\]\{\}:;\'\,.&lt;&gt;/?]{1}[^`~!@$%^&amp;()+=|\\\[\]\{\}:;\'\,.&lt;&gt;?]{0,19}$"<br />Case "Int" '整数<br />patrn="^[1-9]{1}[0-9]{0,6}$"<br />Case "Array"<br />patrn="^[0-9]{1}([0-9]|[\,]){0,150}$"<br />End Select<br />Dim regEx<br />Dim Match<br />Set regEx = New RegExp<br />regEx.Pattern = patrn<br />regEx.IgnoreCase = True<br />regEx.Global = True<br />Matches = regEx.test(strng)<br />IsVerify = Matches<br />Set regEx = Nothing<br />End Function</p><p>'********************************************<br />'函数功能：对输入框的特殊字串进行过滤保存<br />'参数strPass：过滤前的字符串<br />'返回值：过滤后的字符串<br />'********************************************<br />Function SQLencode(byVal strPass)<br />strPass = Replace(strPass, "&amp;", "&amp;")<br />strPass = Replace(strPass, "&lt;", "&lt;")<br />strPass = Replace(strPass, "&gt;", "&gt;")<br />strPass = Replace(strPass, """", """)<br />strPass = Replace(strPass, "'", "'")<br />strPass = Replace(strPass, " ", "　")<br />strPass = Replace(strPass,chr(13)&amp;chr(10),"&lt;br/&gt;")<br />SQLencode = strPass<br />End Function</p><p>'********************************************<br />'函数功能：对SQLencode函数过滤后的字符串进行还原<br />'参数strPass：经过过滤后的字符串<br />'返回值：还原的过滤前的字符串<br />'********************************************<br />Function SQLdecode(byVal strPass)<br />If Not isNull(strPass) Then<br />strPass = Replace(strPass, "&lt;", "&lt;")<br />strPass = Replace(strPass, "&gt;", "&gt;")<br />strPass = Replace(strPass, ""","""" )<br />strPass = Replace(strPass, "'","'" )<br />strPass = Replace(strPass,"&lt;br/&gt;",chr(13)&amp;chr(10))<br />End If<br />SQLdecode = strPass<br />End Function</p><p>'********************************************<br />'函数功能：生成随机密码（字符为数字与大小写字母集合）<br />'参数length：密码长度<br />'返回值：随机密码<br />'********************************************<br />Function random(length)<br />Dim n,str<br />rnds=""<br />Randomize<br />For i=1 To length<br />n=Int(75*Rnd+48)<br />If (n&gt;57 and n&lt;65) Or (n&gt;90 and n&lt;97) Then<br />i=i-1<br />Else<br />rnds=rnds&amp;Chr(n)<br />End If<br />Next<br />random=rnds<br />End Function</p><p>'********************************************<br />'函数功能：对密码进行加密/解密（最大长度为15位）<br />'********************************************<br />Function Encrypt(preString)<br />Dim pwds,s<br />pwds=""<br />s=Left(preString,15)<br />For i=1 To Len(s)<br />seed=170-Asc(Mid(s,i,1))-i<br />pwds=pwds &amp; Chr(seed)<br />Next<br />Encrypt=pwds<br />End Function</p><p>'********************************************<br />'函数功能：格式化当前时间字串<br />'参数：无<br />'返回值：返回当前时间的纯数字字符串方式的表示（例如：当前时间2001-10-3 2:34:6，返回字符串"20011003023406"）<br />'********************************************<br />Function TheDate()<br />y=year(date())<br />m=month(date())<br />d=day(date())<br />h=Hour(time())<br />n=Minute(time())<br />s=Second(time())<br />If Len(m)=1 Then m="0"&amp;m<br />If Len(d)=1 Then d="0"&amp;d<br />If Len(h)=1 Then h="0"&amp;h<br />If Len(n)=1 Then n="0"&amp;n<br />If Len(s)=1 Then s="0"&amp;s<br />thedate=y&amp;m&amp;d&amp;h&amp;n&amp;s<br />End Function</p><p>'********************************************<br />'函数功能：返回字符串的长度<br />'参数：字符串<br />'返回值：字符串长度<br />'********************************************<br />Function strLen(str)<br />dim p_len<br />p_len=0<br />strlen=0<br />if trim(str)&lt;&gt;"" then<br />p_len=len(trim(str))<br />for xx=1 to p_len<br />if asc(mid(str,xx,1))&lt;0 then<br />strlen=int(strlen) + 2<br />else<br />strlen=int(strlen) + 1<br />end if<br />next<br />end if<br />End Function</p><p>'********************************************<br />'函数功能：发送邮件通知<br />'参数：字符串<br />'返回值：成功/失败<br />'********************************************<br />Function SendMail(ToAddress, Subject, Body)<br />On Error Resume Next<br />Set objMail = Server.CreateObject("JMail.Message")<br />objMail.From = ADR_Email<br />objMail.FromName = "ADR管理中心"<br />objMail.Subject = Subject<br />objMail.AddRecipient ToAddress<br />objMail.Body = Body<br />If objMail.Send("") Then<br />SendMail = True<br />Else<br />SendMail = False<br />End If<br />If Err.Number&lt;&gt; 0 Then SendMail = False<br />Set objMail = Nothing<br />On Error Goto 0<br />End Function<br />%&gt;<br />-----------------------------------------------------------------------------------</p><p>//检验法人代码<br />function isCorporationCode(s){<br />var patrn=/^(\d){15}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验登录名：只能输入5-20个以字母开头、可带数字、“_”、“.”的字串<br />function isRegisterUserName(s)<br />{<br />var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9._]){4,19}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}<br />//校验用户姓名：只能输入1-30个以字母开头的字串<br />function isTrueName(s)<br />{<br />var patrn=/^[^`~!@#$%^&amp;*()+-=|\\\[\]\{\}:;\'\,.&lt;&gt;/? 0-9]{2,19}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验密码：只能输入6-15个字母、数字<br />function isPasswd(s)<br />{<br />var patrn=/^[a-zA-Z0-9]{6,15}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//检验体重<br />function isAvoirdupois(s)<br />{<br />var patrn=/^[1-9]{1}[0-9]{0,2}$/;<br />var patrn2=/^[1-9]{1}$/;<br />var intPart=s.indexOf('.');<br />var decPart=s.lastIndexOf('.');<br />if (intPart==-1 &amp;&amp; patrn.exec(s) &amp;&amp; eval(s)&gt;=2 &amp;&amp; eval(s)&lt;=200) return true<br />if (intPart!=decPart || intPart==0 || intPart+2!=s.length) return false<br />if (!patrn.exec(s.substring(0,intPart)) || !patrn2.exec(s.substring(decPart+1))) return false<br />if (eval(s)&lt;2 || eval(s)&gt;200) return false<br />return true<br />}</p><p>//校验普通电话、传真号码：可以“+”开头，除数字外，可含有“-”<br />function isTel(s)<br />{<br />var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验手机号码：必须以数字开头，除数字外，可含有“-”<br />function isMobile(s)<br />{<br />var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验地区代码<br />function isAreaCode(s)<br />{<br />var patrn=/^(\d){6}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验邮政编码<br />function isPostalCode(s)<br />{<br />var patrn=/^[1-9]{1}(\d){5}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验搜索关键字<br />function isSearch(s)<br />{<br />var patrn=/^[^`~!@#$%^&amp;*()+=|\\\[\]\{\}:;\'\,.&lt;&gt;/? ]{1}[^`~!@$%^&amp;()+=|\\\[\]\{\}:;\'\,.&lt;&gt;?]{0,19}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//校验是否为ip地址<br />function isIP(s)<br />{<br />var patrn=/^[0-9.]{1,20}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//检验页码是否正确<br />function isPage(s)<br />{<br />var patrn=/^[1-9]{1}[0-9]{0,2}$/;<br />if (!patrn.exec(s)) return false<br />return true<br />}</p><p>//表单输入值错误提示<br />function vErr(o,s){<br />alert(s);<br />if (o) o.focus();<br />return false;<br />}</p><p>//判断单选<br />function chkRadio(o){<br />for (i=0;i&lt;o.length;i++){<br />if (o[i].checked) return true;<br />}<br />return false;<br />} </p><img src ="http://www.phpweblog.net/kiyone/aggbug/1003.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-03-16 18:24 <a href="http://www.phpweblog.net/kiyone/archive/2007/03/16/1003.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PHP Ajax实现页面无刷新</title><link>http://www.phpweblog.net/kiyone/archive/2007/03/16/1001.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Fri, 16 Mar 2007 10:02:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/03/16/1001.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/1001.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/03/16/1001.html#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/1001.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/1001.html</trackback:ping><description><![CDATA[转载自 <a href="http://hi.baidu.com/isnono/blog/item/6a9791828bd3bebf6c8119b1.html">http://hi.baidu.com/isnono/blog/item/6a9791828bd3bebf6c8119b1.html</a><br />大家都有在网站发表评论的经历，传统的发表过程无非是：发表－&gt;提交页面表单－&gt;等待刷新页面，这样在网络比较拥挤的时候，往往需要漫长的等待，今天介绍用PHP+Ajax实现页面无刷新发表评论，希望对初学ajax的PHPer有所帮助。   那么首先，我们需要一个基本的ajax开发框架，文件ajax.js就包含了这个框架，代码如下：<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 id="Code_Closed_Image_174739" onclick="this.style.display='none'; Code_Closed_Text_174739.style.display='none'; Code_Open_Image_174739.style.display='inline'; Code_Open_Text_174739.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" /><img id="Code_Open_Image_174739" style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_174739.style.display='none'; Code_Closed_Image_174739.style.display='inline'; Code_Closed_Text_174739.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top" /><span id="Code_Closed_Text_174739" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"></span><span id="Code_Open_Text_174739" style="DISPLAY: none"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> http_request</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000"> send_request(url)    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">初始化，指定处理函数，发送请求的函数</span><span style="COLOR: #008000"><br /><img id="Codehighlighter1_75_959_Open_Image" onclick="this.style.display='none'; Codehighlighter1_75_959_Open_Text.style.display='none'; Codehighlighter1_75_959_Closed_Image.style.display='inline'; Codehighlighter1_75_959_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_75_959_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_75_959_Closed_Text.style.display='none'; Codehighlighter1_75_959_Open_Image.style.display='inline'; Codehighlighter1_75_959_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_75_959_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_75_959_Open_Text"><span style="COLOR: #000000">{   <br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    http_request</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">开始初始化XMLHttpRequest对象</span><span style="COLOR: #008000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(window.XMLHttpRequest)   </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">Mozilla浏览器</span><span style="COLOR: #008000"><br /><img id="Codehighlighter1_181_357_Open_Image" onclick="this.style.display='none'; Codehighlighter1_181_357_Open_Text.style.display='none'; Codehighlighter1_181_357_Closed_Image.style.display='inline'; Codehighlighter1_181_357_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_181_357_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_181_357_Closed_Text.style.display='none'; Codehighlighter1_181_357_Open_Image.style.display='inline'; Codehighlighter1_181_357_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span style="COLOR: #000000">    </span><span id="Codehighlighter1_181_357_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_181_357_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        http_request</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> XMLHttpRequest();<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(http_request.overrideMimeType)</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">设置MIME类别</span><span style="COLOR: #008000"><br /><img id="Codehighlighter1_286_351_Open_Image" onclick="this.style.display='none'; Codehighlighter1_286_351_Open_Text.style.display='none'; Codehighlighter1_286_351_Closed_Image.style.display='inline'; Codehighlighter1_286_351_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_286_351_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_286_351_Closed_Text.style.display='none'; Codehighlighter1_286_351_Open_Image.style.display='inline'; Codehighlighter1_286_351_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span style="COLOR: #000000">        </span><span id="Codehighlighter1_286_351_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_286_351_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            http_request.overrideMimeType(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">text/xml</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(window.ActiveXObject)  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">IE浏览器</span><span style="COLOR: #008000"><br /><img id="Codehighlighter1_406_695_Open_Image" onclick="this.style.display='none'; Codehighlighter1_406_695_Open_Text.style.display='none'; Codehighlighter1_406_695_Closed_Image.style.display='inline'; Codehighlighter1_406_695_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_406_695_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_406_695_Closed_Text.style.display='none'; Codehighlighter1_406_695_Open_Image.style.display='inline'; Codehighlighter1_406_695_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span style="COLOR: #000000">    </span><span id="Codehighlighter1_406_695_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_406_695_Open_Text"><span style="COLOR: #000000">{   <br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">try</span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_431_503_Open_Image" onclick="this.style.display='none'; Codehighlighter1_431_503_Open_Text.style.display='none'; Codehighlighter1_431_503_Closed_Image.style.display='inline'; Codehighlighter1_431_503_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_431_503_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_431_503_Closed_Text.style.display='none'; Codehighlighter1_431_503_Open_Image.style.display='inline'; Codehighlighter1_431_503_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_431_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_431_503_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            http_request</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> ActiveXObject(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Msxml2.XMLHttp</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">catch</span><span style="COLOR: #000000">(e)<br /><img id="Codehighlighter1_530_689_Open_Image" onclick="this.style.display='none'; Codehighlighter1_530_689_Open_Text.style.display='none'; Codehighlighter1_530_689_Closed_Image.style.display='inline'; Codehighlighter1_530_689_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_530_689_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_530_689_Closed_Text.style.display='none'; Codehighlighter1_530_689_Open_Image.style.display='inline'; Codehighlighter1_530_689_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_530_689_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_530_689_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="COLOR: #0000ff">try</span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_560_643_Open_Image" onclick="this.style.display='none'; Codehighlighter1_560_643_Open_Text.style.display='none'; Codehighlighter1_560_643_Closed_Image.style.display='inline'; Codehighlighter1_560_643_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_560_643_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_560_643_Closed_Text.style.display='none'; Codehighlighter1_560_643_Open_Image.style.display='inline'; Codehighlighter1_560_643_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_560_643_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_560_643_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                http_request</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> ActiveXobject(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Microsoft.XMLHttp</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="COLOR: #0000ff">catch</span><span style="COLOR: #000000">(e)<br /><img id="Codehighlighter1_665_679_Open_Image" onclick="this.style.display='none'; Codehighlighter1_665_679_Open_Text.style.display='none'; Codehighlighter1_665_679_Closed_Image.style.display='inline'; Codehighlighter1_665_679_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_665_679_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_665_679_Closed_Text.style.display='none'; Codehighlighter1_665_679_Open_Image.style.display='inline'; Codehighlighter1_665_679_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_665_679_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_665_679_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">http_request)  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">异常，创建对象实例失败</span><span style="COLOR: #008000"><br /><img id="Codehighlighter1_738_806_Open_Image" onclick="this.style.display='none'; Codehighlighter1_738_806_Open_Text.style.display='none'; Codehighlighter1_738_806_Closed_Image.style.display='inline'; Codehighlighter1_738_806_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_738_806_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_738_806_Closed_Text.style.display='none'; Codehighlighter1_738_806_Open_Image.style.display='inline'; Codehighlighter1_738_806_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span style="COLOR: #000000">    </span><span id="Codehighlighter1_738_806_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_738_806_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        window.alert(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">创建XMLHttp对象失败！</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    http_request.onreadystatechange</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">processrequest;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">确定发送请求方式，URL，及是否同步执行下段代码</span><span style="COLOR: #008000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">    http_request.open(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">GET</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,url,</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    http_request.send(</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">处理返回信息的函数</span><span style="COLOR: #008000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000"> processrequest()<br /><img id="Codehighlighter1_999_1289_Open_Image" onclick="this.style.display='none'; Codehighlighter1_999_1289_Open_Text.style.display='none'; Codehighlighter1_999_1289_Closed_Image.style.display='inline'; Codehighlighter1_999_1289_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_999_1289_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_999_1289_Closed_Text.style.display='none'; Codehighlighter1_999_1289_Open_Image.style.display='inline'; Codehighlighter1_999_1289_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_999_1289_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_999_1289_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(http_request.readyState</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">)  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">判断对象状态</span><span style="COLOR: #008000"><br /><img id="Codehighlighter1_1050_1287_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1050_1287_Open_Text.style.display='none'; Codehighlighter1_1050_1287_Closed_Image.style.display='inline'; Codehighlighter1_1050_1287_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1050_1287_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1050_1287_Closed_Text.style.display='none'; Codehighlighter1_1050_1287_Open_Image.style.display='inline'; Codehighlighter1_1050_1287_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span style="COLOR: #000000">    </span><span id="Codehighlighter1_1050_1287_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_1050_1287_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(http_request.status</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">200</span><span style="COLOR: #000000">)  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">信息已成功返回，开始处理信息</span><span style="COLOR: #008000"><br /><img id="Codehighlighter1_1115_1205_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1115_1205_Open_Text.style.display='none'; Codehighlighter1_1115_1205_Closed_Image.style.display='inline'; Codehighlighter1_1115_1205_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1115_1205_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1115_1205_Closed_Text.style.display='none'; Codehighlighter1_1115_1205_Open_Image.style.display='inline'; Codehighlighter1_1115_1205_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span style="COLOR: #000000">        </span><span id="Codehighlighter1_1115_1205_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_1115_1205_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            document.getElementById(reobj).innerHTML</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">http_request.responseText;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">页面不正常</span><span style="COLOR: #008000"><br /><img id="Codehighlighter1_1237_1281_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1237_1281_Open_Text.style.display='none'; Codehighlighter1_1237_1281_Closed_Image.style.display='inline'; Codehighlighter1_1237_1281_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1237_1281_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1237_1281_Closed_Text.style.display='none'; Codehighlighter1_1237_1281_Open_Image.style.display='inline'; Codehighlighter1_1237_1281_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span style="COLOR: #000000">        </span><span id="Codehighlighter1_1237_1281_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_1237_1281_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            alert(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">您所请求的页面不正常！</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000"> checkfourm(obj)<br /><img id="Codehighlighter1_1316_1964_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1316_1964_Open_Text.style.display='none'; Codehighlighter1_1316_1964_Closed_Image.style.display='inline'; Codehighlighter1_1316_1964_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1316_1964_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1316_1964_Closed_Text.style.display='none'; Codehighlighter1_1316_1964_Open_Image.style.display='inline'; Codehighlighter1_1316_1964_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_1316_1964_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_1316_1964_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> f</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">document.fourm;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> newfourm</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">f.newfourm.value;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> username</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">f.username.value;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> id</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">f.id.value;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(username</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">""</span><span style="COLOR: #000000">)<br /><img id="Codehighlighter1_1462_1598_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1462_1598_Open_Text.style.display='none'; Codehighlighter1_1462_1598_Closed_Image.style.display='inline'; Codehighlighter1_1462_1598_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1462_1598_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1462_1598_Closed_Text.style.display='none'; Codehighlighter1_1462_1598_Open_Image.style.display='inline'; Codehighlighter1_1462_1598_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_1462_1598_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_1462_1598_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        document.getElementById(obj).innerHTML</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&lt;img src=images/false.gif&gt; &lt;font color=red&gt;您必须先登录！&lt;/font&gt;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(newfourm</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">""</span><span style="COLOR: #000000">)<br /><img id="Codehighlighter1_1630_1769_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1630_1769_Open_Text.style.display='none'; Codehighlighter1_1630_1769_Closed_Image.style.display='inline'; Codehighlighter1_1630_1769_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1630_1769_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1630_1769_Closed_Text.style.display='none'; Codehighlighter1_1630_1769_Open_Image.style.display='inline'; Codehighlighter1_1630_1769_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_1630_1769_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_1630_1769_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        document.getElementById(obj).innerHTML</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&lt;img src=images/false.gif&gt; &lt;font color=red&gt;您还没填写评论内容！&lt;/font&gt;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_1784_1962_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1784_1962_Open_Text.style.display='none'; Codehighlighter1_1784_1962_Closed_Image.style.display='inline'; Codehighlighter1_1784_1962_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1784_1962_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1784_1962_Closed_Text.style.display='none'; Codehighlighter1_1784_1962_Open_Image.style.display='inline'; Codehighlighter1_1784_1962_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_1784_1962_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_1784_1962_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        document.getElementById(obj).innerHTML</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">正在发送数据<img src="http://www.phpweblog.net/images/dot.gif" /></span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        send_request('sendnewfourm.php</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">username</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">username</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">newfourm</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">newfourm</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">&amp;</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">id);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        reobj</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">obj;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span></span></div>有一点ajax基础的通过注释，应该都可以看懂这段代码，我们可以看出，当我们开始发表评论的时候，在一个特定位置先显示：正在发送数据...。接着调用回调函数处理数据。那么请看服务器端的代码：<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 id="Code_Closed_Image_175105" onclick="this.style.display='none'; Code_Closed_Text_175105.style.display='none'; Code_Open_Image_175105.style.display='inline'; Code_Open_Text_175105.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" /><img id="Code_Open_Image_175105" style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_175105.style.display='none'; Code_Closed_Image_175105.style.display='inline'; Code_Closed_Text_175105.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top" /><span id="Code_Closed_Text_175105" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"></span><span id="Code_Open_Text_175105" style="DISPLAY: none"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">&lt;?</span><span style="COLOR: #000000">php<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />    header('Content</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">Type:text</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">html;charset</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">GB2312');</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">避免输出中文乱码，linux下不需要</span><span style="COLOR: #008000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">    $username</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">trim($_GET['username']);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />    $newfourm</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">trim($_GET['newfourm']);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />    $id</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">$_GET['id'];<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />    $time</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">date(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Y-m-d</span><span style="COLOR: #000000">"</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" />    include('inc</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">config.inc.php');<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />    include('inc</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">dbclass.php');<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />    $db</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> db;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">从数据库操作类生成实例</span><span style="COLOR: #008000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">    $db</span><span style="COLOR: #000000">-&gt;</span><span style="COLOR: #000000">mysql($dbhost,$dbuser,$dbpassword,$dbname);</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">调用连接参数函数</span><span style="COLOR: #008000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">    $db</span><span style="COLOR: #000000">-&gt;</span><span style="COLOR: #000000">createcon();</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">调用创建连接函数</span><span style="COLOR: #008000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />    $addsql</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">insert into cr_fourm values(0,'$newfourm','$username','$time',$id)</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />    $db</span><span style="COLOR: #000000">-&gt;</span><span style="COLOR: #000000">query($addsql);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />    echo</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&lt;img src=images/pass.gif&gt; &lt;font color=red&gt;评论已成功发表！&lt;/font&gt;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">echo $addsql;</span><span style="COLOR: #008000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">    $db</span><span style="COLOR: #000000">-&gt;</span><span style="COLOR: #000000">close();</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">关闭数据库连接</span><span style="COLOR: #008000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">?&gt;</span></span></div>由于jsvascript采用UTF8编码，在windows下采用ajax回送服务器的返回信息就会出现乱码，因此在win下应用开头第一句是非常必要的。中间那段两个包含文件是数据库操作类和数据库配置信息，我个人习惯将基本的数据库操作写成一个类，方便调用。到这里相信大家已经基本明白这个程序的工作原理了，在给出页面的HTML代码：<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 id="Code_Closed_Image_175846" onclick="this.style.display='none'; Code_Closed_Text_175846.style.display='none'; Code_Open_Image_175846.style.display='inline'; Code_Open_Text_175846.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" /><img id="Code_Open_Image_175846" style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_175846.style.display='none'; Code_Closed_Image_175846.style.display='inline'; Code_Closed_Text_175846.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top" /><span id="Code_Closed_Text_175846" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"></span><span id="Code_Open_Text_175846" style="DISPLAY: none"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">table </span><span style="COLOR: #ff0000">width</span><span style="COLOR: #0000ff">="100%"</span><span style="COLOR: #ff0000"> border</span><span style="COLOR: #0000ff">="0"</span><span style="COLOR: #ff0000"> cellspacing</span><span style="COLOR: #0000ff">="0"</span><span style="COLOR: #ff0000"> cellpadding</span><span style="COLOR: #0000ff">="0"</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">tr</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">td </span><span style="COLOR: #ff0000">align</span><span style="COLOR: #0000ff">="center"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #0000ff">&lt;?</span><span style="COLOR: #ff00ff">php echo $rows_p[p_info];</span><span style="COLOR: #0000ff">?&gt;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">td</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">tr</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">tr</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">td </span><span style="COLOR: #ff0000">align</span><span style="COLOR: #0000ff">="center"</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">br</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">iframe </span><span style="COLOR: #ff0000">frameborder</span><span style="COLOR: #0000ff">="0"</span><span style="COLOR: #ff0000"> scrolling</span><span style="COLOR: #0000ff">="auto"</span><span style="COLOR: #ff0000"> src</span><span style="COLOR: #0000ff">="showfourm.php?picid=&lt;?=$id;?&gt;"</span><span style="COLOR: #ff0000"> style</span><span style="COLOR: #0000ff">=HEIGHT:250px;VISIBILITY:inherit;WIDTH:<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #ff0000">98%;Z-INDEX:2 </span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">iframe</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">td</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">tr</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">tr</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">td </span><span style="COLOR: #ff0000">align</span><span style="COLOR: #0000ff">="center"</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">br</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 </span><span style="COLOR: #ff0000">align</span><span style="COLOR: #0000ff">="center"</span><span style="COLOR: #ff0000"> id</span><span style="COLOR: #0000ff">="result"</span><span style="COLOR: #0000ff">&gt;&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">form </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="fourm"</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">table </span><span style="COLOR: #ff0000">width</span><span style="COLOR: #0000ff">="100%"</span><span style="COLOR: #ff0000"> border</span><span style="COLOR: #0000ff">="0"</span><span style="COLOR: #ff0000"> cellspacing</span><span style="COLOR: #0000ff">="0"</span><span style="COLOR: #ff0000"> cellpadding</span><span style="COLOR: #0000ff">="0"</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">tr</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">td </span><span style="COLOR: #ff0000">height</span><span style="COLOR: #0000ff">="25"</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">span </span><span style="COLOR: #ff0000">class</span><span style="COLOR: #0000ff">="STYLE1"</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">input </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="username"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="text"</span><span style="COLOR: #ff0000"> value</span><span style="COLOR: #0000ff">="&lt;?=$username?&gt;"</span><span style="COLOR: #ff0000"> readonly</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">span</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">td</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">tr</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">tr</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">td </span><span style="COLOR: #ff0000">height</span><span style="COLOR: #0000ff">="32"</span><span style="COLOR: #ff0000"> align</span><span style="COLOR: #0000ff">="center"</span><span style="COLOR: #ff0000"> valign</span><span style="COLOR: #0000ff">="middle"</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">textarea </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="newfourm"</span><span style="COLOR: #ff0000"> class</span><span style="COLOR: #0000ff">="f"</span><span style="COLOR: #ff0000"> id</span><span style="COLOR: #0000ff">="newfourm"</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">textarea</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">td</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">tr</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">tr</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">td </span><span style="COLOR: #ff0000">height</span><span style="COLOR: #0000ff">="32"</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">input </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="submit"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="button"</span><span style="COLOR: #ff0000"> value</span><span style="COLOR: #0000ff">="发表评论"</span><span style="COLOR: #ff0000"> onClick</span><span style="COLOR: #0000ff">="checkfourm('result')"</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">input </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="reset"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="reset"</span><span style="COLOR: #ff0000"> id</span><span style="COLOR: #0000ff">="reset"</span><span style="COLOR: #ff0000"> value</span><span style="COLOR: #0000ff">="重新填写"</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">input </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="id"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="hidden"</span><span style="COLOR: #ff0000"> id</span><span style="COLOR: #0000ff">="id"</span><span style="COLOR: #ff0000"> value</span><span style="COLOR: #0000ff">="&lt;?php echo"</span><span style="COLOR: #ff0000">$id";?</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">"&gt;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />            </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">td</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">tr</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">table</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">form</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">td</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">tr</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">table</span><span style="COLOR: #0000ff">&gt;</span></span></div>这是我网页的一部分，也就是实现这一功能的框架代码，显示评论的页面用IFRAME（隐藏帧）调用，待信息发送完之后，只刷新IFRAME那一块就可以看到自己发的评论，从发送到查看，整个过程都不需要刷新整个页面。好了，最后看看效果图吧！^_^<br />   1.点击“提交”，开始发送数据<br /><img src="http://leehui1983.bokee.com/photo/view.fcgi?mode=3&amp;id=4037814" /><br />2. 数据发送成功<br /><img src="http://leehui1983.bokee.com/photo/view.fcgi?mode=3&amp;id=4037844" /><br />3. 刷新评论列表<br /><img src="http://leehui1983.bokee.com/photo/view.fcgi?mode=3&amp;id=4037875" /><img src ="http://www.phpweblog.net/kiyone/aggbug/1001.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-03-16 18:02 <a href="http://www.phpweblog.net/kiyone/archive/2007/03/16/1001.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>页面刷新之后下拉菜单选中值不变</title><link>http://www.phpweblog.net/kiyone/archive/2007/03/16/998.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Fri, 16 Mar 2007 08:34:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/03/16/998.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/998.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/03/16/998.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/998.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/998.html</trackback:ping><description><![CDATA[&lt;style&gt;<br />      .userData {behavior:url(#default#userdata);}<br />&lt;/style&gt;<br />&lt;select id="select1"  class="userData"&gt;<br />&lt;option&gt;option1&lt;/option&gt;<br />&lt;option&gt;option2&lt;/option&gt;<br />&lt;option&gt;option3&lt;/option&gt;<br />&lt;option&gt;option4&lt;/option&gt;<br />&lt;/select&gt;<br />&lt;script&gt;<br />var obj=document.all.select1;<br />obj.attachEvent('onchange',saveSelectedIndex)<br />function saveSelectedIndex(){<br />obj.setAttribute("sSelectValue",obj.selectedIndex);<br />obj.save("oSltIndex");<br />}<br />window.attachEvent('onload',loadSelectedIndex)<br />function loadSelectedIndex(){<br />obj.load("oSltIndex");<br />obj.selectedIndex=obj.getAttribute("sSelectValue");<br />}<br />&lt;/script&gt;<br /><img src ="http://www.phpweblog.net/kiyone/aggbug/998.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-03-16 16:34 <a href="http://www.phpweblog.net/kiyone/archive/2007/03/16/998.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ajax实现无刷新三联动下拉框 </title><link>http://www.phpweblog.net/kiyone/archive/2007/03/16/997.html</link><dc:creator>鱼有所思</dc:creator><author>鱼有所思</author><pubDate>Fri, 16 Mar 2007 08:31:00 GMT</pubDate><guid>http://www.phpweblog.net/kiyone/archive/2007/03/16/997.html</guid><wfw:comment>http://www.phpweblog.net/kiyone/comments/997.html</wfw:comment><comments>http://www.phpweblog.net/kiyone/archive/2007/03/16/997.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/kiyone/comments/commentRss/997.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/kiyone/services/trackbacks/997.html</trackback:ping><description><![CDATA[
		<img src="http://singlepine.cnblogs.com/images/cnblogs_com/singlepine/XmlHttpdropdownlist.JPG" />
		<br />1.html代码<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: #800000">HTML</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">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">Ajax实现无刷新三联动下拉框</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" />        </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">meta </span><span style="COLOR: #ff0000">content</span><span style="COLOR: #0000ff">="Microsoft Visual Studio .NET 7.1"</span><span style="COLOR: #ff0000"> name</span><span style="COLOR: #0000ff">="GENERATOR"</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 </span><span style="COLOR: #ff0000">content</span><span style="COLOR: #0000ff">="C#"</span><span style="COLOR: #ff0000"> name</span><span style="COLOR: #0000ff">="CODE_LANGUAGE"</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 </span><span style="COLOR: #ff0000">content</span><span style="COLOR: #0000ff">="JavaScript"</span><span style="COLOR: #ff0000"> name</span><span style="COLOR: #0000ff">="vs_defaultClientScript"</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 </span><span style="COLOR: #ff0000">content</span><span style="COLOR: #0000ff">="http://schemas.microsoft.com/intellisense/ie5"</span><span style="COLOR: #ff0000"> name</span><span style="COLOR: #0000ff">="vs_targetSchema"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_379_3620_Open_Image" onclick="this.style.display='none'; Codehighlighter1_379_3620_Open_Text.style.display='none'; Codehighlighter1_379_3620_Closed_Image.style.display='inline'; Codehighlighter1_379_3620_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_379_3620_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_379_3620_Closed_Text.style.display='none'; Codehighlighter1_379_3620_Open_Image.style.display='inline'; Codehighlighter1_379_3620_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 </span><span style="COLOR: #ff0000">language</span><span style="COLOR: #0000ff">="javascript"</span><span style="COLOR: #0000ff">&gt;</span><span id="Codehighlighter1_379_3620_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_379_3620_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: #008000; BACKGROUND-COLOR: #f5f5f5">//</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">城市------------------------------</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">            </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> cityResult() <br /><img id="Codehighlighter1_486_645_Open_Image" onclick="this.style.display='none'; Codehighlighter1_486_645_Open_Text.style.display='none'; Codehighlighter1_486_645_Closed_Image.style.display='inline'; Codehighlighter1_486_645_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_486_645_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_486_645_Closed_Text.style.display='none'; Codehighlighter1_486_645_Open_Image.style.display='inline'; Codehighlighter1_486_645_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_486_645_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_486_645_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: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> city</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">document.getElementById(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">DropDownList1</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" />                AjaxMethod.GetCityList(city.value,get_city_Result_CallBack);<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" />            </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> get_city_Result_CallBack(response)<br /><img id="Codehighlighter1_728_1494_Open_Image" onclick="this.style.display='none'; Codehighlighter1_728_1494_Open_Text.style.display='none'; Codehighlighter1_728_1494_Closed_Image.style.display='inline'; Codehighlighter1_728_1494_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_728_1494_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_728_1494_Closed_Text.style.display='none'; Codehighlighter1_728_1494_Open_Image.style.display='inline'; Codehighlighter1_728_1494_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_728_1494_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_728_1494_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: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> (response.value </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">!=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">null</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br /><img id="Codehighlighter1_790_1441_Open_Image" onclick="this.style.display='none'; Codehighlighter1_790_1441_Open_Text.style.display='none'; Codehighlighter1_790_1441_Closed_Image.style.display='inline'; Codehighlighter1_790_1441_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_790_1441_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_790_1441_Closed_Text.style.display='none'; Codehighlighter1_790_1441_Open_Image.style.display='inline'; Codehighlighter1_790_1441_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                </span><span id="Codehighlighter1_790_1441_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_790_1441_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: #008000; BACKGROUND-COLOR: #f5f5f5">//</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">debugger;</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">                    document.all(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">DropDownList2</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).length</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;　　　　            <br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　            </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> ds </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> response.value;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                    </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(ds </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">!=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">null</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;&amp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">typeof</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(ds) </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">==</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">object</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;&amp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> ds.Tables </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">!=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">null</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br /><img id="Codehighlighter1_1063_1423_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1063_1423_Open_Text.style.display='none'; Codehighlighter1_1063_1423_Closed_Image.style.display='inline'; Codehighlighter1_1063_1423_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1063_1423_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1063_1423_Closed_Text.style.display='none'; Codehighlighter1_1063_1423_Open_Image.style.display='inline'; Codehighlighter1_1063_1423_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                    </span><span id="Codehighlighter1_1063_1423_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_1063_1423_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: #0000ff; BACKGROUND-COLOR: #f5f5f5">for</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> i</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">; i</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">ds.Tables[</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">].Rows.length; i</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">++</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br /><img id="Codehighlighter1_1175_1401_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1175_1401_Open_Text.style.display='none'; Codehighlighter1_1175_1401_Closed_Image.style.display='inline'; Codehighlighter1_1175_1401_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1175_1401_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1175_1401_Closed_Text.style.display='none'; Codehighlighter1_1175_1401_Open_Image.style.display='inline'; Codehighlighter1_1175_1401_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />　　　　                </span><span id="Codehighlighter1_1175_1401_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_1175_1401_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: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> name</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">ds.Tables[</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">].Rows[i].city;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> id</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">ds.Tables[</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">].Rows[i].cityID;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　                document.all(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">DropDownList2</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).options.add(</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">new</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> Option(name,id));<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/ExpandedSubBlockEnd.gif" align="top" />                    }</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" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">return</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" />            </span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</span><span style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">市区----------------------------------------</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">            </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> areaResult() <br /><img id="Codehighlighter1_1600_1759_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1600_1759_Open_Text.style.display='none'; Codehighlighter1_1600_1759_Closed_Image.style.display='inline'; Codehighlighter1_1600_1759_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1600_1759_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1600_1759_Closed_Text.style.display='none'; Codehighlighter1_1600_1759_Open_Image.style.display='inline'; Codehighlighter1_1600_1759_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_1600_1759_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_1600_1759_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: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> area</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">document.getElementById(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">DropDownList2</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" />                AjaxMethod.GetAreaList(area.value,get_area_Result_CallBack);<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" />            </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> get_area_Result_CallBack(response)<br /><img id="Codehighlighter1_1829_2561_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1829_2561_Open_Text.style.display='none'; Codehighlighter1_1829_2561_Closed_Image.style.display='inline'; Codehighlighter1_1829_2561_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1829_2561_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1829_2561_Closed_Text.style.display='none'; Codehighlighter1_1829_2561_Open_Image.style.display='inline'; Codehighlighter1_1829_2561_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_1829_2561_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_1829_2561_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: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> (response.value </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">!=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">null</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br /><img id="Codehighlighter1_1891_2524_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1891_2524_Open_Text.style.display='none'; Codehighlighter1_1891_2524_Closed_Image.style.display='inline'; Codehighlighter1_1891_2524_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1891_2524_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1891_2524_Closed_Text.style.display='none'; Codehighlighter1_1891_2524_Open_Image.style.display='inline'; Codehighlighter1_1891_2524_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                </span><span id="Codehighlighter1_1891_2524_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_1891_2524_Open_Text"><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{                    <br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                    document.all(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">DropDownList3</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).length</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;　　　　            <br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　            </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> ds </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> response.value;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                    </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(ds </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">!=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">null</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;&amp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">typeof</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(ds) </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">==</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">object</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&amp;&amp;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> ds.Tables </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">!=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">null</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br /><img id="Codehighlighter1_2132_2506_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2132_2506_Open_Text.style.display='none'; Codehighlighter1_2132_2506_Closed_Image.style.display='inline'; Codehighlighter1_2132_2506_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_2132_2506_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2132_2506_Closed_Text.style.display='none'; Codehighlighter1_2132_2506_Open_Image.style.display='inline'; Codehighlighter1_2132_2506_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                    </span><span id="Codehighlighter1_2132_2506_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_2132_2506_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: #0000ff; BACKGROUND-COLOR: #f5f5f5">for</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> i</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">; i</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">ds.Tables[</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">].Rows.length; i</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">++</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br /><img id="Codehighlighter1_2244_2468_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2244_2468_Open_Text.style.display='none'; Codehighlighter1_2244_2468_Closed_Image.style.display='inline'; Codehighlighter1_2244_2468_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_2244_2468_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2244_2468_Closed_Text.style.display='none'; Codehighlighter1_2244_2468_Open_Image.style.display='inline'; Codehighlighter1_2244_2468_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />　　　　                </span><span id="Codehighlighter1_2244_2468_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_2244_2468_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: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> name</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">ds.Tables[</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">].Rows[i].area;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> id</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">ds.Tables[</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">].Rows[i].areaID;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　                document.all(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">DropDownList3</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).options.add(</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">new</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> Option(name,id));<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/ExpandedSubBlockEnd.gif" align="top" />                    }</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" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">return</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" />            </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> getData()<br /><img id="Codehighlighter1_2606_3611_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2606_3611_Open_Text.style.display='none'; Codehighlighter1_2606_3611_Closed_Image.style.display='inline'; Codehighlighter1_2606_3611_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_2606_3611_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2606_3611_Closed_Text.style.display='none'; Codehighlighter1_2606_3611_Open_Image.style.display='inline'; Codehighlighter1_2606_3611_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_2606_3611_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_2606_3611_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: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> province</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">document.getElementById(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">DropDownList1</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" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> pindex </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> province.selectedIndex;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> pValue </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> province.options[pindex].value;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> pText  </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> province.options[pindex].text;<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: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> city</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">document.getElementById(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">DropDownList2</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" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> cindex </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> city.selectedIndex;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> cValue </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> city.options[cindex].value;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> cText  </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> city.options[cindex].text;<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: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> area</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">document.getElementById(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">DropDownList3</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" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> aindex </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> area.selectedIndex;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> aValue </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> area.options[aindex].value;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> aText  </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> area.options[aindex].text;<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: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> txt</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">document.getElementById(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">TextBox1</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/InBlock.gif" align="top" />                document.getElementById(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;%=TextBox1.ClientID%&gt;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).innerText</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">省:</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">pValue</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">|</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">pText</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">市:</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">cValue</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">|</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">cText</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">区:</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">aValue</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">|</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">aText;<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/ExpandedBlockEnd.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" />    </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 </span><span style="COLOR: #ff0000">ms_positioning</span><span style="COLOR: #0000ff">="GridLayout"</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">form </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="Form1"</span><span style="COLOR: #ff0000"> method</span><span style="COLOR: #0000ff">="post"</span><span style="COLOR: #ff0000"> runat</span><span style="COLOR: #0000ff">="server"</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">TABLE </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="Table1"</span><span style="COLOR: #ff0000"> style</span><span style="COLOR: #0000ff">="Z-INDEX: 101; LEFT: 96px; POSITION: absolute; TOP: 32px"</span><span style="COLOR: #ff0000"> cellSpacing</span><span style="COLOR: #0000ff">="1"</span><span style="COLOR: #ff0000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />                cellPadding</span><span style="COLOR: #0000ff">="1"</span><span style="COLOR: #ff0000"> width</span><span style="COLOR: #0000ff">="300"</span><span style="COLOR: #ff0000"> border</span><span style="COLOR: #0000ff">="1"</span><span style="COLOR: #ff0000"> bgColor</span><span style="COLOR: #0000ff">="#ccff66"</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">TR</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">TD</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">省市</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">TD</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">TD</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">asp:dropdownlist </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="DropDownList1"</span><span style="COLOR: #ff0000"> runat</span><span style="COLOR: #0000ff">="server"</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">asp:dropdownlist</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">TD</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">TR</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">TR</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">TD</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">城市</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">TD</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">TD</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">asp:dropdownlist </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="DropDownList2"</span><span style="COLOR: #ff0000"> runat</span><span style="COLOR: #0000ff">="server"</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">asp:dropdownlist</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">TD</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">TR</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">TR</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">TD</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">市区</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">TD</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">TD</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">asp:dropdownlist </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="DropDownList3"</span><span style="COLOR: #ff0000"> runat</span><span style="COLOR: #0000ff">="server"</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">asp:dropdownlist</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">TD</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">TR</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">TABLE</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">asp:TextBox </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="TextBox1"</span><span style="COLOR: #ff0000"> style</span><span style="COLOR: #0000ff">="Z-INDEX: 102; LEFT: 416px; POSITION: absolute; TOP: 48px"</span><span style="COLOR: #ff0000"> runat</span><span style="COLOR: #0000ff">="server"</span><span style="COLOR: #ff0000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />                Width</span><span style="COLOR: #0000ff">="424px"</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">asp:TextBox</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">INPUT </span><span style="COLOR: #ff0000">style</span><span style="COLOR: #0000ff">="Z-INDEX: 103; LEFT: 456px; WIDTH: 56px; POSITION: absolute; TOP: 96px; HEIGHT: 24px"</span><span style="COLOR: #ff0000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />                type</span><span style="COLOR: #0000ff">="button"</span><span style="COLOR: #ff0000"> value</span><span style="COLOR: #0000ff">="test"</span><span style="COLOR: #ff0000"> onclick</span><span style="COLOR: #0000ff">="getData();"</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">form</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</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><br />2.css代码<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 id="Code_Closed_Image_162834" onclick="this.style.display='none'; Code_Closed_Text_162834.style.display='none'; Code_Open_Image_162834.style.display='inline'; Code_Open_Text_162834.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" /><img id="Code_Open_Image_162834" style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_162834.style.display='none'; Code_Closed_Image_162834.style.display='inline'; Code_Closed_Text_162834.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top" /><span id="Code_Closed_Text_162834" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"></span><span id="Code_Open_Text_162834" style="DISPLAY: none"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #800000">using System;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.Collections;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.ComponentModel;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.Data;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.Drawing;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.Web;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.Web.SessionState;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.Web.UI;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.Web.UI.WebControls;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.Web.UI.HtmlControls;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />namespace AjaxTest<br /><img id="Codehighlighter1_266_1313_Open_Image" onclick="this.style.display='none'; Codehighlighter1_266_1313_Open_Text.style.display='none'; Codehighlighter1_266_1313_Closed_Image.style.display='inline'; Codehighlighter1_266_1313_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_266_1313_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_266_1313_Closed_Text.style.display='none'; Codehighlighter1_266_1313_Open_Image.style.display='inline'; Codehighlighter1_266_1313_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_266_1313_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_266_1313_Open_Text"><span style="COLOR: #000000">{</span><span style="COLOR: #ff0000"><br /><img id="Codehighlighter1_272_275_Open_Image" onclick="this.style.display='none'; Codehighlighter1_272_275_Open_Text.style.display='none'; Codehighlighter1_272_275_Closed_Image.style.display='inline'; Codehighlighter1_272_275_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_272_275_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_272_275_Closed_Text.style.display='none'; Codehighlighter1_272_275_Open_Image.style.display='inline'; Codehighlighter1_272_275_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_272_275_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">/**/</span><span id="Codehighlighter1_272_275_Open_Text"><span style="COLOR: #008000">/**/</span></span><span style="COLOR: #ff0000">/// &lt;summary&gt;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    /// Summary description for WebForm1.<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    /// &lt;/summary&gt;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    public class WebForm1 </span><span style="COLOR: #000000">:</span><span style="COLOR: #0000ff"> System.Web.UI.Page<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" />        protected System.Web.UI.WebControls.DropDownList DropDownList1</span><span style="COLOR: #000000">;</span><span style="COLOR: #ff0000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        protected System.Web.UI.WebControls.DropDownList DropDownList2;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        protected System.Web.UI.WebControls.TextBox TextBox1;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        protected System.Web.UI.WebControls.DropDownList DropDownList3;<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" />        private void Page_Load(object sender, System.EventArgs e)<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" />            Ajax.Utility.RegisterTypeForAjax(typeof(AjaxMethod));<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            if(!Page.IsPostBack)<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" />                this.DropDownList1.DataSource=AjaxMethod.GetProvinceList();<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                this.DropDownList1.DataTextField="province";<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                this.DropDownList1.DataValueField="provinceID";<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                this.DropDownList1.DataBind();<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" />                this.DropDownList1.Attributes.Add("onclick","cityResult();");<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />                this.DropDownList2.Attributes.Add("onclick","areaResult();");<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />            </span><span style="COLOR: #000000">}</span></span><span style="COLOR: #800000"><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" /><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        Web Form Designer generated code#region Web Form Designer generated code<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        override protected void OnInit(EventArgs e)<br /><img id="Codehighlighter1_1467_1650_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1467_1650_Open_Text.style.display='none'; Codehighlighter1_1467_1650_Closed_Image.style.display='inline'; Codehighlighter1_1467_1650_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1467_1650_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1467_1650_Closed_Text.style.display='none'; Codehighlighter1_1467_1650_Open_Image.style.display='inline'; Codehighlighter1_1467_1650_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />        </span><span id="Codehighlighter1_1467_1650_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_1467_1650_Open_Text"><span style="COLOR: #000000">{</span><span style="COLOR: #ff0000"><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" />            // CODEGEN</span><span style="COLOR: #000000">:</span><span style="COLOR: #0000ff"> This call is required by the ASP.NET Web Form Designer.<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" />            InitializeComponent()</span><span style="COLOR: #000000">;</span><span style="COLOR: #ff0000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            base.OnInit(e);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />        </span><span style="COLOR: #000000">}</span></span><span style="COLOR: #800000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        <br /><img id="Codehighlighter1_1669_1672_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1669_1672_Open_Text.style.display='none'; Codehighlighter1_1669_1672_Closed_Image.style.display='inline'; Codehighlighter1_1669_1672_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1669_1672_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1669_1672_Closed_Text.style.display='none'; Codehighlighter1_1669_1672_Open_Image.style.display='inline'; Codehighlighter1_1669_1672_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />        </span><span id="Codehighlighter1_1669_1672_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">/**/</span><span id="Codehighlighter1_1669_1672_Open_Text"><span style="COLOR: #008000">/**/</span></span><span style="COLOR: #800000">/// &lt;summary&gt;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        /// Required method for Designer support - do not modify<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        /// the contents of this method with the code editor.<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        /// &lt;/summary&gt;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        private void InitializeComponent()<br /><img id="Codehighlighter1_1888_1969_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1888_1969_Open_Text.style.display='none'; Codehighlighter1_1888_1969_Closed_Image.style.display='inline'; Codehighlighter1_1888_1969_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1888_1969_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1888_1969_Closed_Text.style.display='none'; Codehighlighter1_1888_1969_Open_Image.style.display='inline'; Codehighlighter1_1888_1969_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />        </span><span id="Codehighlighter1_1888_1969_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_1888_1969_Open_Text"><span style="COLOR: #000000">{</span><span style="COLOR: #ff0000">    <br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            this.Load += new System.EventHandler(this.Page_Load);<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">}</span></span><span style="COLOR: #800000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        #endregion        <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></div><br />3.AjaxMethod<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 id="Code_Closed_Image_162906" onclick="this.style.display='none'; Code_Closed_Text_162906.style.display='none'; Code_Open_Image_162906.style.display='inline'; Code_Open_Text_162906.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" /><img id="Code_Open_Image_162906" style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_162906.style.display='none'; Code_Closed_Image_162906.style.display='inline'; Code_Closed_Text_162906.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top" /><span id="Code_Closed_Text_162906" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"></span><span id="Code_Open_Text_162906" style="DISPLAY: none"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #800000">using System;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.Data;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />using System.Data.SqlClient;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />namespace AjaxTest<br /><img id="Codehighlighter1_81_400_Open_Image" onclick="this.style.display='none'; Codehighlighter1_81_400_Open_Text.style.display='none'; Codehighlighter1_81_400_Closed_Image.style.display='inline'; Codehighlighter1_81_400_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_81_400_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_81_400_Closed_Text.style.display='none'; Codehighlighter1_81_400_Open_Image.style.display='inline'; Codehighlighter1_81_400_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_81_400_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_81_400_Open_Text"><span style="COLOR: #000000">{</span><span style="COLOR: #ff0000"><br /><img id="Codehighlighter1_87_90_Open_Image" onclick="this.style.display='none'; Codehighlighter1_87_90_Open_Text.style.display='none'; Codehighlighter1_87_90_Closed_Image.style.display='inline'; Codehighlighter1_87_90_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_87_90_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_87_90_Closed_Text.style.display='none'; Codehighlighter1_87_90_Open_Image.style.display='inline'; Codehighlighter1_87_90_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_87_90_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">/**/</span><span id="Codehighlighter1_87_90_Open_Text"><span style="COLOR: #008000">/**/</span></span><span style="COLOR: #ff0000">/// &lt;summary&gt;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    /// Summary description for AjaxMethod.<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    /// &lt;/summary&gt;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />    public class AjaxMethod<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" />        GetProvinceList#region GetProvinceList<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />        public static DataSet GetProvinceList()<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" />            string sql="select * from province";<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            return GetDataSet(sql);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />        </span><span style="COLOR: #000000">}</span></span><span style="COLOR: #800000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        #endregion<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" />        GetCityList#region GetCityList<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        [Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.Read)]<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        public  DataSet GetCityList(int provinceid)<br /><img id="Codehighlighter1_586_714_Open_Image" onclick="this.style.display='none'; Codehighlighter1_586_714_Open_Text.style.display='none'; Codehighlighter1_586_714_Closed_Image.style.display='inline'; Codehighlighter1_586_714_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_586_714_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_586_714_Closed_Text.style.display='none'; Codehighlighter1_586_714_Open_Image.style.display='inline'; Codehighlighter1_586_714_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />        </span><span id="Codehighlighter1_586_714_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_586_714_Open_Text"><span style="COLOR: #000000">{</span><span style="COLOR: #ff0000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            string sql="select * from city where father="+provinceid;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            return GetDataSet(sql);            <br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />        </span><span style="COLOR: #000000">}</span></span><span style="COLOR: #800000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        #endregion<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" />        GetAreaList#region GetAreaList<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        [Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.Read)]<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        public  DataSet GetAreaList(int cityid)<br /><img id="Codehighlighter1_896_1020_Open_Image" onclick="this.style.display='none'; Codehighlighter1_896_1020_Open_Text.style.display='none'; Codehighlighter1_896_1020_Closed_Image.style.display='inline'; Codehighlighter1_896_1020_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_896_1020_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_896_1020_Closed_Text.style.display='none'; Codehighlighter1_896_1020_Open_Image.style.display='inline'; Codehighlighter1_896_1020_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />        </span><span id="Codehighlighter1_896_1020_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_896_1020_Open_Text"><span style="COLOR: #000000">{</span><span style="COLOR: #ff0000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            string sql="select * from area where father="+cityid;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            return GetDataSet(sql);            <br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />        </span><span style="COLOR: #000000">}</span></span><span style="COLOR: #800000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        #endregion<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" />        GetDataSet#region GetDataSet<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        public static DataSet GetDataSet(string sql)<br /><img id="Codehighlighter1_1144_1430_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1144_1430_Open_Text.style.display='none'; Codehighlighter1_1144_1430_Closed_Image.style.display='inline'; Codehighlighter1_1144_1430_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1144_1430_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1144_1430_Closed_Text.style.display='none'; Codehighlighter1_1144_1430_Open_Image.style.display='inline'; Codehighlighter1_1144_1430_Open_Text.style.display='inline';" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />        </span><span id="Codehighlighter1_1144_1430_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_1144_1430_Open_Text"><span style="COLOR: #000000">{</span><span style="COLOR: #ff0000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            string ConnectionString=System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            SqlDataAdapter    sda =new SqlDataAdapter(sql,ConnectionString);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            DataSet ds=new DataSet();<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            sda.Fill(ds);<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/InBlock.gif" align="top" />            return ds;<br /><img src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />        </span><span style="COLOR: #000000">}</span></span><span style="COLOR: #800000"><br /><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" />        #endregion<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></div>4.web.config<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 id="Code_Closed_Image_163006" onclick="this.style.display='none'; Code_Closed_Text_163006.style.display='none'; Code_Open_Image_163006.style.display='inline'; Code_Open_Text_163006.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" /><img id="Code_Open_Image_163006" style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_163006.style.display='none'; Code_Closed_Image_163006.style.display='inline'; Code_Closed_Text_163006.style.display='inline';" height="16" src="http://www.phpweblog.net/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top" /><span id="Code_Closed_Text_163006" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"></span><span id="Code_Open_Text_163006" style="DISPLAY: none"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><img src="http://www.phpweblog.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">httpHandlers</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">add </span><span style="COLOR: #ff0000">verb</span><span style="COLOR: #0000ff">="POST,GET"</span><span style="COLOR: #ff0000"> path</span><span style="COLOR: #0000ff">="ajax/*.ashx"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="Ajax.PageHandlerFactory, Ajax"</span><span style="COLOR: #ff0000"> </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">httpHandlers</span><span style="COLOR: #0000ff">&gt;</span></span></div><br />5.ajax.dll下载<a href="http://singlepine.cnblogs.com/Files/singlepine/Ajax.rar"><font color="#000080">/Files/singlepine/Ajax.rar</font></a><br />6.真实数据库下载<a href="http://singlepine.cnblogs.com/Files/singlepine/area1.rar"><font color="#000080">area1.rar</font></a><br />7.源代码下载<a href="http://singlepine.cnblogs.com/Files/singlepine/AjaxTest.rar"><font color="#002c99">AjaxTest.rar</font></a><img src ="http://www.phpweblog.net/kiyone/aggbug/997.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/kiyone/" target="_blank">鱼有所思</a> 2007-03-16 16:31 <a href="http://www.phpweblog.net/kiyone/archive/2007/03/16/997.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>