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

<channel>
	<title>无风的港湾 &#187; url</title>
	<atom:link href="http://www.5bay.cn/tag/url/feed" rel="self" type="application/rss+xml" />
	<link>http://www.5bay.cn</link>
	<description>让你我停泊~</description>
	<lastBuildDate>Fri, 16 Dec 2011 09:18:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>ASP防注入新方式，希望对大家是有用的</title>
		<link>http://www.5bay.cn/server-building/aspeaojie.html</link>
		<comments>http://www.5bay.cn/server-building/aspeaojie.html#comments</comments>
		<pubDate>Wed, 28 Jul 2010 02:00:27 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[服务器构建&安全]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[人]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[工具]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[程序]]></category>
		<category><![CDATA[类]]></category>
		<category><![CDATA[网站]]></category>
		<category><![CDATA[诫]]></category>
		<category><![CDATA[连接]]></category>
		<category><![CDATA[防注入]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=527</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/server-building/aspeaojie.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>最近我的网站经常把js脚本注入到数据，清除了又来。先后在网上找了很多的方法，还是没有用的，十分恼火。 首先先告诉大家一个批量清除代码的sql语句。 update 表名 set 字段=replace(字段,&#8217;script src=http://3b3.org/c.js&#62; 1、分析那些无聊的人，或者有些病态的人究竟做了些什么 。 通过iis的日志或者microsoft urlscan 日志查看，在一些通过id查询数据库内容的时候后面被人加了一段很长的字符窜。 %%3B%%44%%65%%43%%4C%%61%%52%%45%%类似这样的字符窜，一定是其他的方式编码 首先我们先用工具分析下如此之长的字符窜究竟包含了些什么内容。 通过批量替换工具把%%全部替换成空，然后把得到的字符串通过其他的转码工具，转成字符窜。 ;DeCLaRE @S NvArCHaR(4000);SeT @S=CaSt(0&#215;45这里代码去掉了06F007200 aS NvArChAR(4000));ExEc(@S);&#8211; 就是一段与通过id查询数据库同时执行的sql，就给数据库某些表的字段加入了js病毒连接。 2、所以我们的原来的防sql注入的字符串就需要升级了。 如果过滤16进制 ; 对应 3B DeCLaRE 对应 4465434C615245 @ 对应 40 NvArCHaR 对应 4E76417243486152 set 对应 536554 CaSt 对应 43615374 as 对应 6153 exec 对应 45784563 - 对应 2D 把16进制的代码用&#124;隔开放到injdata 里面 injdata = [...]]]></description>
			<content:encoded><![CDATA[<p>最近我的网站经常把js脚本注入到数据，清除了又来。先后在网上找了很多的方法，还是没有用的，十分恼火。</p>
<p>首先先告诉大家一个批量清除代码的sql语句。</p>
<p>update 表名 set 字段=replace(字段,&#8217;script src=http://3b3.org/c.<a href="http://www.5bay.cn/tag/js" class="st_tag internal_tag" rel="tag" title="标签 js 下的日志">js</a>&gt;<br />
1、分析那些无聊的人，或者有些病态的人究竟做了些什么 。</p>
<p>通过iis的日志或者microsoft urlscan 日志查看，在一些通过id查询数据库内容的时候后面被人加了一段很长的字符窜。</p>
<p>%%3B%%44%%65%%43%%4C%%61%%52%%45%%类似这样的字符窜，一定是其他的方式编码</p>
<p>首先我们先用工具分析下如此之长的字符窜究竟包含了些什么内容。</p>
<p>通过批量替换工具把%%全部替换成空，然后把得到的字符串通过其他的转码工具，转成字符窜。</p>
<p>;DeCLaRE @S NvArCHaR(4000);SeT @S=CaSt(0&#215;45这里代码去掉了06F007200 aS NvArChAR(4000));ExEc(@S);&#8211;</p>
<p>就是一段与通过id查询数据库同时执行的sql，就给数据库某些表的字段加入了js病毒连接。</p>
<p>2、所以我们的原来的防sql注入的字符串就需要升级了。</p>
<p>如果过滤16进制</p>
<p>; 对应 3B</p>
<p>DeCLaRE 对应 4465434C615245</p>
<p>@ 对应 40</p>
<p>NvArCHaR 对应 4E76417243486152</p>
<p>set 对应 536554</p>
<p>CaSt 对应 43615374</p>
<p>as 对应 6153</p>
<p>exec 对应 45784563</p>
<p>- 对应 2D</p>
<p>把16进制的代码用|隔开放到injdata 里面</p>
<p>injdata = “3B|2D|&#8217;|;|and|exec|insert|select|delete%20from|update|count|”</p>
<p>然后自己测试下，程序是否拦击了这些16进制的代码，本人测试过是可以拦击的，如果不加入这些是不拦击的</p>
<p>照样可以注入到数据库。</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeeeeehuai.html" title="PHP对文本数据库的基本操作方法">PHP对文本数据库的基本操作方法</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/eacceleratoryumemcachedequbieyuyongtu.html" title="eAccelerator与memcache的区别与用途">eAccelerator与memcache的区别与用途</a> (2)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/js" title="js" rel="tag">js</a>, <a href="http://www.5bay.cn/tag/sql" title="sql" rel="tag">sql</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/%E4%BA%BA" title="人" rel="tag">人</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%B7%A5%E5%85%B7" title="工具" rel="tag">工具</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE%E5%BA%93" title="数据库" rel="tag">数据库</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/category/server-building" title="服务器构建&amp;安全" rel="tag">服务器构建&amp;安全</a>, <a href="http://www.5bay.cn/tag/%E7%A8%8B%E5%BA%8F" title="程序" rel="tag">程序</a>, <a href="http://www.5bay.cn/tag/%E7%B1%BB" title="类" rel="tag">类</a>, <a href="http://www.5bay.cn/tag/%E7%BD%91%E7%AB%99" title="网站" rel="tag">网站</a>, <a href="http://www.5bay.cn/tag/e" title="诫" rel="tag">诫</a>, <a href="http://www.5bay.cn/tag/%E8%BF%9E%E6%8E%A5" title="连接" rel="tag">连接</a>, <a href="http://www.5bay.cn/tag/%E9%98%B2%E6%B3%A8%E5%85%A5" title="防注入" rel="tag">防注入</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/server-building/aspeaojie.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>让IIS只监听指定IP</title>
		<link>http://www.5bay.cn/server-building/ep.html</link>
		<comments>http://www.5bay.cn/server-building/ep.html#comments</comments>
		<pubDate>Wed, 28 Jul 2010 01:12:50 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[服务器构建&安全]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[成功]]></category>
		<category><![CDATA[诫]]></category>
		<category><![CDATA[错误]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=504</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/server-building/ep.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>放入Windows Server 2003安装光盘，在目录\Support\Tools\下面找到Support.msi文件，安装他。 　　安装文件也可以在http://www.cdnunion.net/soft/support.rar下载。 b.用cmd进入C:\Program Files\Support Tools目录。 c.删除0.0.0.0 　httpcfg delete iplisten -i 0.0.0.0 d.设定HTTP.sys（iis）只是侦听192.168.0.2这个IP地址，运行如下命令： httpcfg set iplisten -i 192.168.0.2 返回的错误代码0代表成功完成 e.重起http.sys，依次在dos模式执行如下命令。 net stop http /y net start w3svc f.查询现在http.sys侦听Web服务的端口。 在dos模式用如下命令： netstat -an 看看 tcp 0.0.0.0:80 0.0.0.0 listening 是否存在，如果不存在，先恭喜一下。 看看 tcp 192.168.0.2:80 &#8230;&#8230;&#8230;&#8230;&#8230; 是否存在，如果是，那就真正恭喜你了。 ########################################################## httpcfg query iplisten 查询 相关博文2010年07月26日 -- PHP和Socket简介 (0)2010年07月26日 -- 最令PHP初学者头痛的十四个问题 (0)2010年07月26日 [...]]]></description>
			<content:encoded><![CDATA[<p>放入Windows <a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">Server</a> 2003安装光盘，在目录\Support\Tools\下面找到Support.msi文件，安装他。<br />
　　安装文件也可以在<a rel="external" href="http://my.dz121.com/link.php?url=http://www.cdnunion.net%2Fsoft%2Fsupport.rar" target="_blank">http://www.cdnunion.net/soft/support.rar</a>下载。<br />
b.用cmd进入C:\Program Files\Support Tools目录。<br />
c.删除0.0.0.0<br />
　httpcfg delete iplisten -i 0.0.0.0<br />
d.设定HTTP.sys（iis）只是侦听192.168.0.2这个IP地址，运行如下命令：<br />
httpcfg set iplisten -i 192.168.0.2<br />
返回的错误代码0代表成功完成<br />
e.重起http.sys，依次在dos模式执行如下命令。<br />
net stop http /y<br />
net start w3svc</p>
<p>f.查询现在http.sys侦听Web服务的端口。<br />
在dos模式用如下命令：<br />
netstat -an<br />
看看 tcp 0.0.0.0:80 0.0.0.0 listening 是否存在，如果不存在，先恭喜一下。<br />
看看 tcp 192.168.0.2:80 &#8230;&#8230;&#8230;&#8230;&#8230; 是否存在，如果是，那就真正恭喜你了。<br />
##########################################################</p>
<p>httpcfg query iplisten 查询</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeeeeehuai.html" title="PHP对文本数据库的基本操作方法">PHP对文本数据库的基本操作方法</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/nginxderewriteguize.html" title="nginx的rewrite规则">nginx的rewrite规则</a> (1)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/server" title="server" rel="tag">server</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E6%88%90%E5%8A%9F" title="成功" rel="tag">成功</a>, <a href="http://www.5bay.cn/category/server-building" title="服务器构建&amp;安全" rel="tag">服务器构建&amp;安全</a>, <a href="http://www.5bay.cn/tag/e" title="诫" rel="tag">诫</a>, <a href="http://www.5bay.cn/tag/%E9%94%99%E8%AF%AF" title="错误" rel="tag">错误</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/server-building/ep.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>最令PHP初学者头痛的十四个问题</title>
		<link>http://www.5bay.cn/network-programming/eeeeeeee.html</link>
		<comments>http://www.5bay.cn/network-programming/eeeeeeee.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 17:20:55 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[iis6.0]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[上传]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[兼容]]></category>
		<category><![CDATA[初学者]]></category>
		<category><![CDATA[区别]]></category>
		<category><![CDATA[失败]]></category>
		<category><![CDATA[密码]]></category>
		<category><![CDATA[应用程序]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[版本]]></category>
		<category><![CDATA[程序]]></category>
		<category><![CDATA[网站]]></category>
		<category><![CDATA[解决]]></category>
		<category><![CDATA[解决方法]]></category>
		<category><![CDATA[设计]]></category>
		<category><![CDATA[诫]]></category>
		<category><![CDATA[邮件]]></category>
		<category><![CDATA[错误]]></category>
		<category><![CDATA[页面]]></category>
		<category><![CDATA[验证]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=501</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/eeeeeeee.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>【1】页面之间无法传递变量 get,post,session在最新的php版本中自动全局变量是关闭的，所以要从上一页面取得提交过来得变量要使用$_GET['foo'],$ _POST['foo'],$_SESSION['foo']来得到。当然也可以修改自动全局变量为开(php.ini改为 register_globals = On)；考虑到兼容性，还是强迫自己熟悉新的写法比较好。　　 【2】Win32下apache2 用get方法传递中文参数会出错： test.php?a=你好&#38;b=你也好　 传递参数是会导致一个内部错误　　 解决办法:”test.php?a=”.urlencode(你好).”&#38;b=”.urlencode(你也好)　 【3】win32下的session不能正常工作　 php.ini默认的session.save_path = /tmp　 这显然是linux下的配置，win32下php无法读写session文件导致session无法使用，把它改成一个绝对路径就可以了，例如session.save_path = c:windows emp　　 【4】显示错误信息　 　 当php.ini的display_errors = On并且error_reporting = E_ALL时，将显示所有的错误和提示，调试的时候最好打开以便纠错，如果你用以前php写法错误信息多半是关于未定义变量的。变量在赋值以前调用会有提示，解决办法是探测或者屏蔽。　　 例如显示$foo，可以if(isset($foo)) echo $foo 或者echo @$foo　　 【5】Win32下mail()不能发送电子邮件　　 在linux下配置好的sendmail可以发送，在win32下需要调用smtp服务器来发送电子邮件，修改php.ini的SMTP = ip //ip是不带验证功能的smtp服务器(网上很难找到)　　 php发送邮件的最好解决方法是用socket直接发送到对方email服务器而不用转发服务器。　　 【6】初装的mysql修改密码 应该使用update mysql.user set password=”yourpassword” where user=”root” 修改密码　　 【7】header already sent　　 这个错误通常会在你使用HEADER的时候出现，他可能是几种原因： 1，你在使用HEADER前PRING或者ECHO了 2.你当前文件前面有空行 3.你可能INCLUDE了一个文件,该文件尾部有空行或者输出也会出现这种错误。！　　 【8】更改php.ini后没有变化　　 重新启动web server，比如IIS，Apache等等，然后才会应用最新的设置。 [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-501"></span>【1】页面之间无法传递变量</p>
<p>get,post,session在最新的php版本中自动全局变量是关闭的，所以要从上一页面取得提交过来得变量要使用$_GET['foo'],$ _POST['foo'],$_<a href="http://www.5bay.cn/tag/session" class="st_tag internal_tag" rel="tag" title="标签 session 下的日志">SESSION</a>['foo']来得到。当然也可以修改自动全局变量为开(php.ini改为 register_globals = On)；考虑到兼容性，还是强迫自己熟悉新的写法比较好。　　</p>
<p>【2】Win32下apache2 用get方法传递中文参数会出错：</p>
<p>test.php?a=你好&amp;b=你也好　<br />
传递参数是会导致一个内部错误　　<br />
解决办法:”test.php?a=”.urlencode(你好).”&amp;b=”.urlencode(你也好)　</p>
<p>【3】win32下的session不能正常工作　</p>
<p>php.ini默认的session.save_path = /tmp　<br />
这显然是linux下的配置，win32下php无法读写session文件导致session无法使用，把它改成一个绝对路径就可以了，例如session.save_path = c:windows emp　　</p>
<p>【4】显示错误信息　<br />
　<br />
当php.ini的display_errors = On并且error_reporting = E_ALL时，将显示所有的错误和提示，调试的时候最好打开以便纠错，如果你用以前php写法错误信息多半是关于未定义变量的。变量在赋值以前调用会有提示，解决办法是探测或者屏蔽。　　</p>
<p>例如显示$foo，可以if(isset($foo)) echo $foo 或者echo @$foo　　</p>
<p>【5】Win32下mail()不能发送电子邮件　　</p>
<p>在linux下配置好的sendmail可以发送，在win32下需要调用smtp服务器来发送电子邮件，修改php.ini的SMTP = ip //ip是不带验证功能的smtp服务器(网上很难找到)　　</p>
<p>php发送邮件的最好解决方法是用socket直接发送到对方email服务器而不用转发服务器。　　</p>
<p>【6】初装的mysql修改密码</p>
<p>应该使用update mysql.user set password=”yourpassword” where user=”root” 修改密码　　</p>
<p>【7】header already sent　　</p>
<p>这个错误通常会在你使用HEADER的时候出现，他可能是几种原因：</p>
<p>1，你在使用HEADER前PRING或者ECHO了<br />
2.你当前文件前面有空行<br />
3.你可能INCLUDE了一个文件,该文件尾部有空行或者输出也会出现这种错误。！　　</p>
<p>【8】更改php.ini后没有变化　　</p>
<p>重新启动web <a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">server</a>，比如IIS，Apache等等，然后才会应用最新的设置。<br />
这个我要补充一下，如果你是iis服务器请在cmd下用iisreset命令重新起动。用信息管理服务器重起是不起作用的。</p>
<p>【9】php在2003上面安装　<br />
　<br />
PHP4的php4isapi.dll好像和2003有些冲突，只能用CGI模式安装　　</p>
<p>步骤一，先www.php.net 下在一个安装程序，我是装的是：php-4.2.3-installer.exe，你也可以去找最新的版本，在安装php-4.2.3- installer.exe之前保证你的IIS6.0启动了，并能够访问。安装好以后，在默认网站&#8211;＞应用程序配置。　　<br />
步骤二：点击 web服务扩展 &#8211;＞新建web服务扩展。　　<br />
步骤三： 扩展名&#8211;＞php,然后添加　　<br />
步骤四：找到php.exe的路径添加上去。　　<br />
步骤五： 确定就可以了！　　　<br />
步骤六： 选择php的服务扩展，然后点击允许。　这点很重要，以前的iis5.1都没web服务扩展这项，所以用惯iis5.1的朋友很容易忽略这项。</p>
<p>【10】sql语句不起作用</p>
<p>sql语句不起作用，对数据库操作失败，最简便的调试方法，echo那句sql，看看变量的值能得到不。　<br />
　<br />
【11】include和require的区别　　</p>
<p>两者没有太大的区别，如果要包含的文件不存在，include提示notice，然后继续执行下面的语句，require提示致命错误并且退出。　　</p>
<p>据我测试，win32平台下它们都是先包含后执行，所以被包含文件里最好不要再有include或require语句，这样会造成目录混乱。</p>
<p>如果一个文件不想被包含多次可以使用include_once或require_once## 读取，写入文档数据。<br />
function r($file_name) {　<br />
$filenum=@fopen($file_name,”r”);　<br />
@flock($filenum,LOCK_SH);　<br />
$file_data=@fread($filenum,filesize($file_name));　<br />
@fclose($filenum);　<br />
return $file_data;}<br />
function w($file_name,$data,$method=”w”){　<br />
$filenum=@fopen($file_name,$method);　<br />
flock($filenum,LOCK_EX);　<br />
$file_data=fwrite($filenum,$data);　<br />
fclose($filenum);　<br />
return $file_data;}</p>
<p>【12】isset()和empty()的区别　　</p>
<p>两者都是测试变量用的，但是isset()是测试变量是否被赋值，而empty()是测试一个已经被赋值的变量是否为空。　　</p>
<p>如果一个变量没被赋值就引用在php里是被允许的,但会有notice提示，如果一个变量被赋空值，$foo=”"或者$foo=0或者 $foo=false,那么empty($foo)返回真，isset($foo)也返回真，就是说赋空值不会注销一个变量。　　　要注销一个变量，可以用 unset($foo)或者$foo=NULL　　</p>
<p>【13】mysql查询语句包含有关键字　</p>
<p>　php查询mysql的时候，有时候mysql表名或者列名会有关键字，这时候查询会有错误。例如表名是order,查询时候会出错，简单的办法是sql语句里表名或者列名加上`[tab键上面]来加以区别，例如select * from `order`　　</p>
<p>【14】通过HTTP协议一次上传多个文件的方法　　</p>
<p>有两个思路，是同一个方法的两种实现。具体程序还需自己去设计。　　<br />
1、在form中设置多个文件输入框，用数组命名他们的名字，如下：</p>
<p>＜form action=”" method=post＞<br />
＜input type=file name=usefile[]＞<br />
＜input type=file name=usefile[]＞<br />
＜input type=file name=usefile[]＞<br />
＜/form＞<br />
　　<br />
这样，在服务器端做以下测试：echo “＜pre＞”;print_r($_FILES);echo “＜/pre＞”;　　</p>
<p>2、在form中设置多个文件输入框，但名字不同，如下：</p>
<p>＜form action=”" method=post＞<br />
＜input type=file name=usefile_a＞<br />
＜input type=file name=usefile_b＞<br />
＜input type=file name=usefile_c＞<br />
＜/form＞　</p>
<p>　在服务器端做同样测试：echo “＜pre＞”;print_r($_FILES);echo “＜/pre＞”;</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeeeeehuai.html" title="PHP对文本数据库的基本操作方法">PHP对文本数据库的基本操作方法</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/nginxderewriteguize.html" title="nginx的rewrite规则">nginx的rewrite规则</a> (1)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/apache2" title="apache2" rel="tag">apache2</a>, <a href="http://www.5bay.cn/tag/code" title="code" rel="tag">code</a>, <a href="http://www.5bay.cn/tag/iis60" title="iis6.0" rel="tag">iis6.0</a>, <a href="http://www.5bay.cn/tag/include" title="include" rel="tag">include</a>, <a href="http://www.5bay.cn/tag/mysql" title="mysql" rel="tag">mysql</a>, <a href="http://www.5bay.cn/tag/path" title="path" rel="tag">path</a>, <a href="http://www.5bay.cn/category/network-programming/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/phpini" title="php.ini" rel="tag">php.ini</a>, <a href="http://www.5bay.cn/tag/server" title="server" rel="tag">server</a>, <a href="http://www.5bay.cn/tag/session" title="session" rel="tag">session</a>, <a href="http://www.5bay.cn/tag/sql" title="sql" rel="tag">sql</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/%E4%B8%8A%E4%BC%A0" title="上传" rel="tag">上传</a>, <a href="http://www.5bay.cn/tag/%E4%B8%AD%E6%96%87" title="中文" rel="tag">中文</a>, <a href="http://www.5bay.cn/tag/%E5%85%BC%E5%AE%B9" title="兼容" rel="tag">兼容</a>, <a href="http://www.5bay.cn/tag/%E5%88%9D%E5%AD%A6%E8%80%85" title="初学者" rel="tag">初学者</a>, <a href="http://www.5bay.cn/tag/%E5%8C%BA%E5%88%AB" title="区别" rel="tag">区别</a>, <a href="http://www.5bay.cn/tag/%E5%A4%B1%E8%B4%A5" title="失败" rel="tag">失败</a>, <a href="http://www.5bay.cn/tag/%E5%AF%86%E7%A0%81" title="密码" rel="tag">密码</a>, <a href="http://www.5bay.cn/tag/%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F" title="应用程序" rel="tag">应用程序</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE%E5%BA%93" title="数据库" rel="tag">数据库</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/tag/%E7%89%88%E6%9C%AC" title="版本" rel="tag">版本</a>, <a href="http://www.5bay.cn/tag/%E7%A8%8B%E5%BA%8F" title="程序" rel="tag">程序</a>, <a href="http://www.5bay.cn/tag/%E7%BD%91%E7%AB%99" title="网站" rel="tag">网站</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a>, <a href="http://www.5bay.cn/tag/%E8%A7%A3%E5%86%B3" title="解决" rel="tag">解决</a>, <a href="http://www.5bay.cn/tag/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95" title="解决方法" rel="tag">解决方法</a>, <a href="http://www.5bay.cn/tag/%E8%AE%BE%E8%AE%A1" title="设计" rel="tag">设计</a>, <a href="http://www.5bay.cn/tag/e" title="诫" rel="tag">诫</a>, <a href="http://www.5bay.cn/tag/%E9%82%AE%E4%BB%B6" title="邮件" rel="tag">邮件</a>, <a href="http://www.5bay.cn/tag/%E9%94%99%E8%AF%AF" title="错误" rel="tag">错误</a>, <a href="http://www.5bay.cn/tag/%E9%A1%B5%E9%9D%A2" title="页面" rel="tag">页面</a>, <a href="http://www.5bay.cn/tag/%e9%aa%8c%e8%af%81" title="验证" rel="tag">验证</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/eeeeeeee.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX应用程序开发七宗罪</title>
		<link>http://www.5bay.cn/network-programming/ajaxeeaoe.html</link>
		<comments>http://www.5bay.cn/network-programming/ajaxeeaoe.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 16:53:25 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[JavaScript&Ajax]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[dhtml]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[人]]></category>
		<category><![CDATA[应用程序]]></category>
		<category><![CDATA[搜索]]></category>
		<category><![CDATA[新手]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[更新]]></category>
		<category><![CDATA[浏览器]]></category>
		<category><![CDATA[程序]]></category>
		<category><![CDATA[自身]]></category>
		<category><![CDATA[设计]]></category>
		<category><![CDATA[诫]]></category>
		<category><![CDATA[链接]]></category>
		<category><![CDATA[错误]]></category>
		<category><![CDATA[页面]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=484</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>AJAX bandwagon是个好去处。它带给你更快、更高效、更强动态的应用。但它也有自身的缺陷。 初一看，具备一些常识似乎就能避免这些缺陷，在一定程度上，的确如此。但从DHTML起源来看，AJAX应用程序充满了结构性差异。不论你在应用程序开发工作中掌握了多少常识，从别人犯的错误中吸取教训也是有好处的。我们称这些错误为“七宗死罪”，但它们不能代表全部的错误。 事实上，在你犯这些致命过失之前，你可能首先犯了一些较轻的错误。因此我们从这里着手。这是每个人都可能犯的错误。这些错误是多么普遍，通过Google搜索一下，你就可以发现大部分的错误。 七宗轻罪 1．滥用Back按钮—这是每个人都会犯的错误。Back按钮在很多网页程序中已经成为用户的期望。很多AJAX研发新手在开发AJAX应用程序时，出于多种原因都敏捷地使用着Back按钮。首先，JavaScript对于它来说不是最友好的语言；其次，AJAX设计中需要一种全新的思考方式。 对于AJAX 研发新手“后退”显然不是最好的选择。“后退”是一种你更新页面，或更常见的，你需要在特定情况下进行“撤销”时才用到的功能。在进行编码前应认识到这些，或者你可能重复做功。 2．忘记告诉用户当前发生的状况—AJAX工作原理中的一部分是其不使用常规的网页用户界面加载程序。因此，你需要明确设计一些可视的提示，使用户了解正在发生的状况。 3．忽视链接—这也是AJAX的标准失误：漏做了程序外部用户可以剪贴的URL链接。我们都曾经多少次复制过URL链接然后将其发送给别人？当你在使用AJAX 时，提供给你的用户有用URL链接的唯一方法是，手动提供给他们。为什么？因为在AJAX程序中，服务器不提供JavaScript动态生成的这个页面！不要忽视你的用户可能感兴趣的这个网络应用中最普通的功能。既然服务器不支持，那你花点功夫为用户提供URLs。 4．用内容控制替代控制—如果你正在寻找动态的内容控制，那么对传统的客户服务器交互作用的突破对你来说可是件好事。但这也是一项罪过：在重写一个页面的某精确位置上的内容以调整用户的交互式体验时确实确实能够很好的控制，但这也将使你的页面不完整。通常，我们专注于处理页面的某一部分，而忘记服务器不刷新页面。这会导致页面凌乱，用户体验降低，当他们察看页面时可能看到过时的页面!把你的注意力放在整个页面; 确保出现动态页面的内容都得到更新。 5.累死蜘蛛 –AJAX的优势在于无需重装就可以提供给页面的大量的文本；AJAX的缺陷在于无需重装就可以提供给页面的大量的文本。如果应用被设置为对搜索引擎友好，那么，你能够想象会出现什么情况。无论页面中出现了什么，请务必在最上面植入足够稳定的文本，为蜘蛛们去玩耍吧。 产生乱码文本—AJAX不支持很多字符集。这不是涉及生死的局限性，但忘记它能够产生真的问题。最基本的字符集是UTF-8。不论JavaScript发送什么，别忘记正确地编码，并且根据内容设置服务器端的字符集。 没有为使用不支持JavaScript的浏览器的用户提供提示&#8211;有些浏览器不支持JavaScript，用户一时不能明白出了什么状况。请给他们提供提示。 实话实说，其中大部分是常识性问题。真正的问题都很容易让人忽视的。 相关博文2010年07月26日 -- ajax的缺点 (0)2010年07月26日 -- 使用Ajax时的十个常犯的错误 (0)2010年07月26日 -- 基于JSON的高级AJAX开发技术 (0)2010年07月26日 -- Ajax的工作原理 (1)2010年05月23日 -- 《高性能网站建设指南》读书笔记 (0)2010年07月26日 -- 最令PHP初学者头痛的十四个问题 (0)2010年07月26日 -- AJAX的各种控件和类库 (0)2010年07月26日 -- XMLHTTP对象封装技术 (0)2010年07月26日 -- PHP安全之数据过滤 (0)2010年07月26日 -- 深入探讨PHP中的内存管理问题 (0)2008年10月17日 -- 以人为本，美术资源的归档 (0)2010年07月26日 -- PHP和Socket简介 (0)2010年07月26日 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.5bay.cn/tag/ajax" class="st_tag internal_tag" rel="tag" title="标签 ajax 下的日志">AJAX</a> bandwagon是个好去处。它带给你更快、更高效、更强动态的应用。但它也有自身的缺陷。</p>
<p>初一看，具备一些常识似乎就能避免这些缺陷，在一定程度上，的确如此。但从DHTML起源来看，AJAX应用程序充满了结构性差异。不论你在应用程序开发工作中掌握了多少常识，从别人犯的错误中吸取教训也是有好处的。我们称这些错误为“七宗死罪”，但它们不能代表全部的错误。</p>
<p>事实上，在你犯这些致命过失之前，你可能首先犯了一些较轻的错误。因此我们从这里着手。这是每个人都可能犯的错误。这些错误是多么普遍，通过Google搜索一下，你就可以发现大部分的错误。<br />
<span id="more-484"></span><br />
七宗轻罪</p>
<p>1．滥用Back按钮—这是每个人都会犯的错误。Back按钮在很多网页程序中已经成为用户的期望。很多AJAX研发新手在开发AJAX应用程序时，出于多种原因都敏捷地使用着Back按钮。首先，JavaScript对于它来说不是最友好的语言；其次，AJAX设计中需要一种全新的思考方式。</p>
<p>对于AJAX 研发新手“后退”显然不是最好的选择。“后退”是一种你更新页面，或更常见的，你需要在特定情况下进行“撤销”时才用到的功能。在进行编码前应认识到这些，或者你可能重复做功。</p>
<p>2．忘记告诉用户当前发生的状况—AJAX工作原理中的一部分是其不使用常规的网页用户界面加载程序。因此，你需要明确设计一些可视的提示，使用户了解正在发生的状况。</p>
<p>3．忽视链接—这也是AJAX的标准失误：漏做了程序外部用户可以剪贴的URL链接。我们都曾经多少次复制过URL链接然后将其发送给别人？当你在使用AJAX 时，提供给你的用户有用URL链接的唯一方法是，手动提供给他们。为什么？因为在AJAX程序中，服务器不提供JavaScript动态生成的这个页面！不要忽视你的用户可能感兴趣的这个网络应用中最普通的功能。既然服务器不支持，那你花点功夫为用户提供URLs。</p>
<p>4．用内容控制替代控制—如果你正在寻找动态的内容控制，那么对传统的客户服务器交互作用的突破对你来说可是件好事。但这也是一项罪过：在重写一个页面的某精确位置上的内容以调整用户的交互式体验时确实确实能够很好的控制，但这也将使你的页面不完整。通常，我们专注于处理页面的某一部分，而忘记服务器不刷新页面。这会导致页面凌乱，用户体验降低，当他们察看页面时可能看到过时的页面!把你的注意力放在整个页面; 确保出现动态页面的内容都得到更新。</p>
<p>5.累死蜘蛛 –AJAX的优势在于无需重装就可以提供给页面的大量的文本；AJAX的缺陷在于无需重装就可以提供给页面的大量的文本。如果应用被设置为对搜索引擎友好，那么，你能够想象会出现什么情况。无论页面中出现了什么，请务必在最上面植入足够稳定的文本，为蜘蛛们去玩耍吧。</p>
<p>产生乱码文本—AJAX不支持很多字符集。这不是涉及生死的局限性，但忘记它能够产生真的问题。最基本的字符集是UTF-8。不论JavaScript发送什么，别忘记正确地编码，并且根据内容设置服务器端的字符集。<br />
没有为使用不支持JavaScript的浏览器的用户提供提示&#8211;有些浏览器不支持JavaScript，用户一时不能明白出了什么状况。请给他们提供提示。<br />
实话实说，其中大部分是常识性问题。真正的问题都很容易让人忽视的。</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html" title="《高性能网站建设指南》读书笔记">《高性能网站建设指南》读书笔记</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2008年10月17日 -- <a href="http://www.5bay.cn/game-development/%E4%BB%A5%E4%BA%BA%E4%B8%BA%E6%9C%AC%EF%BC%8C%E7%BE%8E%E6%9C%AF%E8%B5%84%E6%BA%90%E7%9A%84%E5%BD%92%E6%A1%A3.html" title="以人为本，美术资源的归档">以人为本，美术资源的归档</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2008年10月17日 -- <a href="http://www.5bay.cn/game-development/%E6%B8%B8%E6%88%8F%E4%B8%AD%E7%9A%84%E8%B4%A7%E5%B8%81.html" title="游戏中的货币">游戏中的货币</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://www.5bay.cn/tag/dhtml" title="dhtml" rel="tag">dhtml</a>, <a href="http://www.5bay.cn/tag/google" title="google" rel="tag">google</a>, <a href="http://www.5bay.cn/tag/html" title="html" rel="tag">html</a>, <a href="http://www.5bay.cn/tag/javascript" title="javascript" rel="tag">javascript</a>, <a href="http://www.5bay.cn/category/network-programming/javascript-ajax" title="JavaScript&amp;Ajax" rel="tag">JavaScript&amp;Ajax</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/%E4%BA%BA" title="人" rel="tag">人</a>, <a href="http://www.5bay.cn/tag/%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F" title="应用程序" rel="tag">应用程序</a>, <a href="http://www.5bay.cn/tag/%E6%90%9C%E7%B4%A2" title="搜索" rel="tag">搜索</a>, <a href="http://www.5bay.cn/tag/%E6%96%B0%E6%89%8B" title="新手" rel="tag">新手</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/tag/%E6%9B%B4%E6%96%B0" title="更新" rel="tag">更新</a>, <a href="http://www.5bay.cn/tag/%E6%B5%8F%E8%A7%88%E5%99%A8" title="浏览器" rel="tag">浏览器</a>, <a href="http://www.5bay.cn/tag/%E7%A8%8B%E5%BA%8F" title="程序" rel="tag">程序</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a>, <a href="http://www.5bay.cn/tag/%E8%87%AA%E8%BA%AB" title="自身" rel="tag">自身</a>, <a href="http://www.5bay.cn/tag/%E8%AE%BE%E8%AE%A1" title="设计" rel="tag">设计</a>, <a href="http://www.5bay.cn/tag/e" title="诫" rel="tag">诫</a>, <a href="http://www.5bay.cn/tag/%E9%93%BE%E6%8E%A5" title="链接" rel="tag">链接</a>, <a href="http://www.5bay.cn/tag/%E9%94%99%E8%AF%AF" title="错误" rel="tag">错误</a>, <a href="http://www.5bay.cn/tag/%E9%A1%B5%E9%9D%A2" title="页面" rel="tag">页面</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/ajaxeeaoe.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax的工作原理</title>
		<link>http://www.5bay.cn/network-programming/ajaxeeee.html</link>
		<comments>http://www.5bay.cn/network-programming/ajaxeeee.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 16:50:59 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[JavaScript&Ajax]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xmlhttp]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[兼容]]></category>
		<category><![CDATA[函数]]></category>
		<category><![CDATA[分页]]></category>
		<category><![CDATA[容器]]></category>
		<category><![CDATA[对象]]></category>
		<category><![CDATA[属性]]></category>
		<category><![CDATA[常用]]></category>
		<category><![CDATA[应用程序]]></category>
		<category><![CDATA[引入]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[更新]]></category>
		<category><![CDATA[浏览器]]></category>
		<category><![CDATA[程序]]></category>
		<category><![CDATA[系统]]></category>
		<category><![CDATA[节点]]></category>
		<category><![CDATA[表格]]></category>
		<category><![CDATA[诫]]></category>
		<category><![CDATA[说明]]></category>
		<category><![CDATA[连接]]></category>
		<category><![CDATA[页面]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=482</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/ajaxeeee.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Ajax的核心是JavaScript对象 XmlHttpRequest。该对象在Internet Explorer 5中首次引入，它是一种支持异步请求的技术。简而言之，XmlHttpRequest使您可以使用JavaScript向服务器提出请求并处理响应，而不阻塞用户。 　　在创建Web站点时，在客户端执行屏幕更新为用户提供了很大的灵活性。下面是使用Ajax可以完成的功能： * 动态更新购物车的物品总数，无需用户单击Update并等待服务器重新发送整个页面。 * 提升站点的性能，这是通过减少从服务器下载的数据量而实现的。例如，在Amazon的购物车页面，当更新篮子中的一项物品的数量时，会重新载入整个页面，这必须下载32K的数据。如果使用Ajax计算新的总量，服务器只会返回新的总量值，因此所需的带宽仅为原来的百分之一。 * 消除了每次用户输入时的页面刷新。例如，在Ajax中，如果用户在分页列表上单击Next，则服务器数据只刷新列表而不是整个页面。 * 直接编辑表格数据，而不是要求用户导航到新的页面来编辑数据。对于Ajax，当用户单击Edit时，可以将静态表格刷新为内容可编辑的表格。用户单击Done之后，就可以发出一个Ajax请求来更新服务器，并刷新表格，使其包含静态、只读的数据。 　　一切皆有可能！但愿它能够激发您开始开发自己的基于Ajax的站点。然而，在开始之前，让我们介绍一个现有的Web站点，它遵循传统的提交/等待/重新显示的范例，我们还将讨论Ajax如何提升用户体验。 原始的Ajax：直接使用XmlHttpRequest 　　如上所述，Ajax的核心是JavaScript对象XmlHttpRequest。下面的示例文章评价系统将带您熟悉Ajax的底层基本知识：http://tearesolutions.com/ajax-demo/raw-ajax.html。注：如果您已经在本地WebLogic容器中安装了ajax-demo.war，可以导航到http://localhost:7001/ajax-demo/raw-ajax.html， 　　浏览应用程序，参与投票，并亲眼看它如何运转。熟悉了该应用程序之后，继续阅读，进一步了解其工作原理细节。 　　首先，您拥有一些简单的定位点标记，它连接到一个JavaScriptcastVote(rank)函数。 function castVote(rank) { var url = “/ajax-demo/static-article-ranking.html”; var callback = processAjaxResponse; executeXhr(callback, url); } 　　该函数为您想要与之通信的服务器资源创建一个URL并调用内部函数executeXhr，提供一个回调JavaScript函数，一旦服务器响应可用，该函数就被执行。由于我希望它运行在一个简单的Apache环境中，“cast vote URL”只是一个简单的HTML页面。在实际情况中，被调用的URL将记录票数并动态地呈现包含投票总数的响应。 　　下一步是发出一个XmlHttpRequest请求： function executeXhr(callback, url) { // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = [...]]]></description>
			<content:encoded><![CDATA[<p>Ajax的核心是JavaScript对象 XmlHttpRequest。该对象在Internet Explorer 5中首次引入，它是一种支持异步请求的技术。简而言之，XmlHttpRequest使您可以使用JavaScript向服务器提出请求并处理响应，而不阻塞用户。 </p>
<p>　　在创建Web站点时，在客户端执行屏幕更新为用户提供了很大的灵活性。下面是使用Ajax可以完成的功能： </p>
<p>* 动态更新购物车的物品总数，无需用户单击Update并等待服务器重新发送整个页面。<br />
* 提升站点的性能，这是通过减少从服务器下载的数据量而实现的。例如，在Amazon的购物车页面，当更新篮子中的一项物品的数量时，会重新载入整个页面，这必须下载32K的数据。如果使用Ajax计算新的总量，服务器只会返回新的总量值，因此所需的带宽仅为原来的百分之一。<br />
* 消除了每次用户输入时的页面刷新。例如，在Ajax中，如果用户在分页列表上单击Next，则服务器数据只刷新列表而不是整个页面。<br />
* 直接编辑表格数据，而不是要求用户导航到新的页面来编辑数据。对于Ajax，当用户单击Edit时，可以将静态表格刷新为内容可编辑的表格。用户单击Done之后，就可以发出一个Ajax请求来更新服务器，并刷新表格，使其包含静态、只读的数据。<br />
　　一切皆有可能！但愿它能够激发您开始开发自己的基于Ajax的站点。然而，在开始之前，让我们介绍一个现有的Web站点，它遵循传统的提交/等待/重新显示的范例，我们还将讨论Ajax如何提升用户体验。 <span id="more-482"></span></p>
<p>原始的Ajax：直接使用XmlHttpRequest </p>
<p>　　如上所述，Ajax的核心是JavaScript对象XmlHttpRequest。下面的示例文章评价系统将带您熟悉Ajax的底层基本知识：http://tearesolutions.com/<a href="http://www.5bay.cn/tag/ajax" class="st_tag internal_tag" rel="tag" title="标签 ajax 下的日志">ajax</a>-demo/raw-<a href="http://www.5bay.cn/tag/ajax" class="st_tag internal_tag" rel="tag" title="标签 ajax 下的日志">ajax</a>.html。注：如果您已经在本地WebLogic容器中安装了ajax-demo.war，可以导航到http://localhost:7001/<a href="http://www.5bay.cn/tag/ajax" class="st_tag internal_tag" rel="tag" title="标签 ajax 下的日志">ajax</a>-demo/raw-<a href="http://www.5bay.cn/tag/ajax" class="st_tag internal_tag" rel="tag" title="标签 ajax 下的日志">ajax</a>.html， </p>
<p>　　浏览应用程序，参与投票，并亲眼看它如何运转。熟悉了该应用程序之后，继续阅读，进一步了解其工作原理细节。<br />
　　首先，您拥有一些简单的定位点标记，它连接到一个JavaScriptcastVote(rank)函数。 </p>
<p>function castVote(rank) {<br />
var <a href="http://www.5bay.cn/tag/url" class="st_tag internal_tag" rel="tag" title="标签 url 下的日志">url</a> = “/ajax-demo/static-article-ranking.html”;<br />
var callback = processAjaxResponse;<br />
executeXhr(callback, url);<br />
} </p>
<p>　　该函数为您想要与之通信的服务器资源创建一个URL并调用内部函数executeXhr，提供一个回调JavaScript函数，一旦服务器响应可用，该函数就被执行。由于我希望它运行在一个简单的Apache环境中，“cast vote URL”只是一个简单的HTML页面。在实际情况中，被调用的URL将记录票数并动态地呈现包含投票总数的响应。<br />
　　下一步是发出一个XmlHttpRequest请求： </p>
<p>function executeXhr(callback, url) {<br />
// branch for native XMLHttpRequest object<br />
if (window.XMLHttpRequest) {<br />
req = new XMLHttpRequest();<br />
req.onreadystatechange = callback;<br />
req.open(“GET”, url, true);<br />
req.send(null);<br />
} // branch for IE/Windows ActiveX version<br />
else if (window.ActiveXObject) {<br />
req = new ActiveXObject(“Microsoft.XMLHTTP”);<br />
if (req) {<br />
req.onreadystatechange = callback;<br />
req.open(“GET”, url, true);<br />
req.send();<br />
}<br />
}<br />
} </p>
<p>　　如您所见，执行一个XmlHttpRequest并不简单，但非常直观。和平常一样，在JavaScript领域，大部分的工作量都花在确保浏览器兼容方面。在这种情况下，首先要确定XmlHttpRequest是否可用。如果不能用，很可能要使用Internet Explorer，这样就要使用所提供的ActiveX实现。 </p>
<p>executeXhr()方法中最关键的部分是这两行： </p>
<p>req.onreadystatechange = callback;<br />
req.open(“GET”, url, true); </p>
<p>　　第一行定义了JavaScript回调函数，您希望一旦响应就绪它就自动执行，而req.open()方法中所指定的“true”标志说明您想要异步执行该请求。<br />
　　一旦服务器处理完XmlHttpRequest并返回给浏览器，使用req.onreadystatechange指派所设置的回调方法将被自动调用。<br />
function processAjaxResponse() {<br />
// only if req shows “loaded”<br />
if (req.readyState == 4) {<br />
// only if “OK”<br />
if (req.status == 200) {<br />
502 502&#8242;votes&#8217;).innerHTML = req.responseText;<br />
} else {<br />
alert(“There was a problem retrieving the XML data:<br />
” +<br />
req.statusText);<br />
}<br />
}<br />
} </p>
<p>　　该代码相当简洁，并且使用了几个幻数，这使得难以一下子看出发生了什么。为了弄清楚这一点，下面的表格（引用自http://developer.apple.com/internet/webcontent/xmlhttpreq.html）列举了常用的XmlHttpRequest对象属性。 </p>
<p><a href="http://www.5bay.cn/tag/%E5%B1%9E%E6%80%A7" class="st_tag internal_tag" rel="tag" title="标签 属性 下的日志">属性</a> </p>
<p>描述 </p>
<p>onreadystatechange </p>
<p>每次状态改变所触发事件的事件处理程序 </p>
<p>readyState </p>
<p>对象状态值： </p>
<p>* 0 = 未初始化（uninitialized）<br />
* 1 = 正在加载（loading）<br />
* 2 = 加载完毕（loaded）<br />
* 3 = 交互（interactive）<br />
* 4 = 完成（complete） </p>
<p>responseText </p>
<p>从服务器进程返回的数据的字符串形式 </p>
<p>responseXML </p>
<p>从服务器进程返回的DOM兼容的文档数据对象 </p>
<p>status </p>
<p>从服务器返回的数字代码，比如404（未找到）或200（就绪） </p>
<p>statusText </p>
<p>伴随状态码的字符串信息 </p>
<p>　　现在processVoteResponse()函数开始显示出其意义了。它首先检查 XmlHttpRequest的整体状态以保证它已经完成（readyStatus == 4），然后根据服务器的设定询问请求状态。如果一切正常（status == 200）,就使用innerHTML属性重写DOM的“votes”节点的内容。 </p>
<p>　　既然您亲眼看到了XmlHttpRequest对象是如何工作的，就让我们利用一个旨在简化JavaScript与Java应用程序之间的异步通信的框架来对具体的细节进行抽象。</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeeeseeao.html" title="ajax基础知识:js事件触发大全">ajax基础知识:js事件触发大全</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://www.5bay.cn/tag/html" title="html" rel="tag">html</a>, <a href="http://www.5bay.cn/tag/ie" title="ie" rel="tag">ie</a>, <a href="http://www.5bay.cn/tag/javascript" title="javascript" rel="tag">javascript</a>, <a href="http://www.5bay.cn/category/network-programming/javascript-ajax" title="JavaScript&amp;Ajax" rel="tag">JavaScript&amp;Ajax</a>, <a href="http://www.5bay.cn/tag/status" title="status" rel="tag">status</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/xml" title="xml" rel="tag">xml</a>, <a href="http://www.5bay.cn/tag/xmlhttp" title="xmlhttp" rel="tag">xmlhttp</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%85%BC%E5%AE%B9" title="兼容" rel="tag">兼容</a>, <a href="http://www.5bay.cn/tag/%E5%87%BD%E6%95%B0" title="函数" rel="tag">函数</a>, <a href="http://www.5bay.cn/tag/%E5%88%86%E9%A1%B5" title="分页" rel="tag">分页</a>, <a href="http://www.5bay.cn/tag/%E5%AE%B9%E5%99%A8" title="容器" rel="tag">容器</a>, <a href="http://www.5bay.cn/tag/%E5%AF%B9%E8%B1%A1" title="对象" rel="tag">对象</a>, <a href="http://www.5bay.cn/tag/%E5%B1%9E%E6%80%A7" title="属性" rel="tag">属性</a>, <a href="http://www.5bay.cn/tag/%E5%B8%B8%E7%94%A8" title="常用" rel="tag">常用</a>, <a href="http://www.5bay.cn/tag/%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F" title="应用程序" rel="tag">应用程序</a>, <a href="http://www.5bay.cn/tag/%E5%BC%95%E5%85%A5" title="引入" rel="tag">引入</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/tag/%E6%9B%B4%E6%96%B0" title="更新" rel="tag">更新</a>, <a href="http://www.5bay.cn/tag/%E6%B5%8F%E8%A7%88%E5%99%A8" title="浏览器" rel="tag">浏览器</a>, <a href="http://www.5bay.cn/tag/%E7%A8%8B%E5%BA%8F" title="程序" rel="tag">程序</a>, <a href="http://www.5bay.cn/tag/%E7%B3%BB%E7%BB%9F" title="系统" rel="tag">系统</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a>, <a href="http://www.5bay.cn/tag/%E8%8A%82%E7%82%B9" title="节点" rel="tag">节点</a>, <a href="http://www.5bay.cn/tag/%E8%A1%A8%E6%A0%BC" title="表格" rel="tag">表格</a>, <a href="http://www.5bay.cn/tag/e" title="诫" rel="tag">诫</a>, <a href="http://www.5bay.cn/tag/%E8%AF%B4%E6%98%8E" title="说明" rel="tag">说明</a>, <a href="http://www.5bay.cn/tag/%E8%BF%9E%E6%8E%A5" title="连接" rel="tag">连接</a>, <a href="http://www.5bay.cn/tag/%E9%A1%B5%E9%9D%A2" title="页面" rel="tag">页面</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/ajaxeeee.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AJAX初学:IE缓存页面的问题</title>
		<link>http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html</link>
		<comments>http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 16:47:20 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[JavaScript&Ajax]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mod]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xmlhttp]]></category>
		<category><![CDATA[人]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[函数]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[页面]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=476</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>做一个项目用到Ajax,开始觉得挺好，后来发现一个问题，例如删除一项，恢复之后就不能再接着删除，必须要等一段时间，后来知道是IE缓存的问题。 　　AJAX缓存页面是一个刚接触AJAX的人一定会遇到的问题，造成这个问题的关键性人物又是IE&#8230; 　　在网上找了好多资料后，总结一下 　　1:在AJAX请求的页面后加个随机函数,我们可以使用随机时间函数 　　在javascript发送的URL后加上t=Math.random() ，当然，不是直接把t=Math.random()拷贝到URL后面,应该像这样:URL+”&#038;”+”t=”+Math.random(); 　　2:在XMLHttpRequest发送请求之前加上XMLHttpRequest.setRequestHeader(“If-Modified-Since”,”0&#8243;) 　　一般情况下,这里的XMLHttpRequest不会直接使用，你应该可以找到这样的代码 XXXXX.send(YYYYYY); 　　那么,就把它变成 XXXXX.setRequestHeader(“If-Modified-Since”,”0&#8243;); XXXXX.send(YYYYYY); 　　第二种方法感觉挺好。 相关博文2010年07月26日 -- Ajax的工作原理 (1)2010年07月26日 -- 使用Ajax时的十个常犯的错误 (0)2010年07月26日 -- AJAX的各种控件和类库 (0)2010年07月26日 -- XMLHTTP对象封装技术 (0)2010年07月26日 -- 基于JSON的高级AJAX开发技术 (0)2010年07月26日 -- ajax的缺点 (0)2010年07月26日 -- AJAX应用程序开发七宗罪 (0)2010年07月26日 -- 了解Ajax中的Get和Post (0)2010年05月23日 -- mysql优化及全文搜索 (0)2010年05月23日 -- 图片轮换类，IE7、OP、FF、Chrome测试通过 (2)2010年05月23日 -- 《高性能网站建设指南》读书笔记 (0)2010年07月26日 -- PHP安全之数据过滤 (0)2010年07月28日 -- ASP防注入新方式，希望对大家是有用的 (0)2010年07月28日 -- Webshell下破解计算机管理员密码 [...]]]></description>
			<content:encoded><![CDATA[<p>做一个项目用到Ajax,开始觉得挺好，后来发现一个问题，例如删除一项，恢复之后就不能再接着删除，必须要等一段时间，后来知道是IE缓存的问题。</p>
<p>　　AJAX缓存页面是一个刚接触AJAX的人一定会遇到的问题，造成这个问题的关键性人物又是IE&#8230; </p>
<p>　　在网上找了好多资料后，总结一下 </p>
<p>　　1:在AJAX请求的页面后加个随机函数,我们可以使用随机时间函数 </p>
<p>　　在javascript发送的URL后加上t=Math.random() ，当然，不是直接把t=Math.random()拷贝到URL后面,应该像这样:<a href="http://www.5bay.cn/tag/url" class="st_tag internal_tag" rel="tag" title="标签 url 下的日志">URL</a>+”&#038;”+”t=”+Math.random(); </p>
<p>　　2:在XMLHttpRequest发送请求之前加上XMLHttpRequest.setRequestHeader(“If-Modified-Since”,”0&#8243;) </p>
<p>　　一般情况下,这里的XMLHttpRequest不会直接使用，你应该可以找到这样的代码</p>
<p>XXXXX.send(YYYYYY); </p>
<p>　　那么,就把它变成 </p>
<p>XXXXX.setRequestHeader(“If-Modified-Since”,”0&#8243;);<br />
XXXXX.send(YYYYYY); </p>
<p>　　第二种方法感觉挺好。</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/tupianlunhuanleiie7opffchromeceshitongguo.html" title="图片轮换类，IE7、OP、FF、Chrome测试通过">图片轮换类，IE7、OP、FF、Chrome测试通过</a> (2)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html" title="《高性能网站建设指南》读书笔记">《高性能网站建设指南》读书笔记</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://www.5bay.cn/tag/ie" title="ie" rel="tag">ie</a>, <a href="http://www.5bay.cn/tag/javascript" title="javascript" rel="tag">javascript</a>, <a href="http://www.5bay.cn/category/network-programming/javascript-ajax" title="JavaScript&amp;Ajax" rel="tag">JavaScript&amp;Ajax</a>, <a href="http://www.5bay.cn/tag/mod" title="mod" rel="tag">mod</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/xml" title="xml" rel="tag">xml</a>, <a href="http://www.5bay.cn/tag/xmlhttp" title="xmlhttp" rel="tag">xmlhttp</a>, <a href="http://www.5bay.cn/tag/%E4%BA%BA" title="人" rel="tag">人</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%87%BD%E6%95%B0" title="函数" rel="tag">函数</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a>, <a href="http://www.5bay.cn/tag/%E9%A1%B5%E9%9D%A2" title="页面" rel="tag">页面</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>了解Ajax中的Get和Post</title>
		<link>http://www.5bay.cn/network-programming/eejaxeeetpit.html</link>
		<comments>http://www.5bay.cn/network-programming/eejaxeeetpit.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 16:45:02 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[JavaScript&Ajax]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xmlhttp]]></category>
		<category><![CDATA[对象]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[方法]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=472</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Get方式: 作用:可传送简单数据 大小:url最大长度是2083 bytes,可以用于GET传递数据的长度是2048 bytes 包含体:数据追加到url中发送,也就是http的header传送 Post方式: 作用:可传送简单复杂数据 大小:web.config里限制 包含体:数据在http请求的实体内容里传送 Ajax用Post模式传送数据.需注意： 1.设置header的Context-Type为application/x-www-form-urlencode确保服务器知道实体中有参数变量.通常使用XmlHttpRequest对象的SetRequestHeader(“Context-Type”,”application/x-www-form-urlencoded;”) 2.参数是名/值一一对应的键值对,每对值用&#038;号隔开.如 name=abc&#038;sex=man&#038;age=18. 3.参数在Send(参数)方法中发送 4.服务器端请求参数区分Get与Post.例如asp.net中以Request.Form["name"]对实体中的参数请求.这时url参数请求Request.QueryString["name"]将引发异常]]></description>
			<content:encoded><![CDATA[<p>Get方式:</p>
<p>作用:可传送简单数据<br />
大小:url最大长度是2083 bytes,可以用于GET传递数据的长度是2048 bytes<br />
包含体:数据追加到url中发送,也就是http的header传送</p>
<p>Post方式:</p>
<p>作用:可传送简单复杂数据<br />
大小:<a href="http://www.5bay.cn/tag/web" class="st_tag internal_tag" rel="tag" title="标签 web 下的日志">web</a>.config里限制<br />
包含体:数据在http请求的实体内容里传送<br />
<span id="more-472"></span><br />
Ajax用Post模式传送数据.需注意：</p>
<p>1.设置header的Context-Type为application/x-www-form-urlencode确保服务器知道实体中有参数变量.通常使用XmlHttpRequest对象的SetRequestHeader(“Context-Type”,”application/x-www-form-urlencoded;”)<br />
2.参数是名/值一一对应的键值对,每对值用&#038;号隔开.如 name=abc&#038;sex=man&#038;age=18.<br />
3.参数在Send(参数)方法中发送<br />
4.服务器端请求参数区分Get与Post.例如asp.net中以Request.Form["name"]对实体中的参数请求.这时url参数请求Request.QueryString["name"]将引发异常</p>
<p><javascript language="javascript><br />
function StateEvent()<br />
{<br />
if(XmlHttpObject.readyState == 4)<br />
{<br />
if(XmlHttpObject.<a href="http://www.5bay.cn/tag/status" class="st_tag internal_tag" rel="tag" title="标签 status 下的日志">status</a> == 200)<br />
{<br />
//code<br />
}<br />
}<br />
}</p>
<p>function CreateXmlHttp()<br />
{<br />
if(window.ActiveXObject)<br />
{<br />
return new ActiveXObject(“Microsoft.<a href="http://www.5bay.cn/tag/xmlhttp" class="st_tag internal_tag" rel="tag" title="标签 xmlhttp 下的日志">XMLHTTP</a>”);<br />
}<br />
else if (window.XMLHttpRequest)<br />
{<br />
return new XmlHttpRequest();<br />
}<br />
}</p>
<p>function Start()<br />
{<br />
var ParamString = “name=abc&#038;sex=man&#038;age=18&#8243;;<br />
var XmlHttpObject = CreateXmlHttp();<br />
XmlHttpObject.onreadystatechange = StateEvent;<br />
XmlHttpObject.open(“post”,”test.aspx”,true);<br />
XmlHttpObject.setRequestHeader(“Content-Type”,”application/x-www-form-urlencoded;”); //设置服务器响应请求体参数<br />
XmlHttpObject.send(ParamString);<br />
}<br />
</script></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html" title="《高性能网站建设指南》读书笔记">《高性能网站建设指南》读书笔记</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeeeseeao.html" title="ajax基础知识:js事件触发大全">ajax基础知识:js事件触发大全</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpzhongdememcachehanshukumemcachefunctions.html" title="PHP中的Memcache函数库（Memcache Functions）">PHP中的Memcache函数库（Memcache Functions）</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/aspnet" title="asp.net" rel="tag">asp.net</a>, <a href="http://www.5bay.cn/tag/code" title="code" rel="tag">code</a>, <a href="http://www.5bay.cn/tag/javascript" title="javascript" rel="tag">javascript</a>, <a href="http://www.5bay.cn/category/network-programming/javascript-ajax" title="JavaScript&amp;Ajax" rel="tag">JavaScript&amp;Ajax</a>, <a href="http://www.5bay.cn/tag/status" title="status" rel="tag">status</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/xml" title="xml" rel="tag">xml</a>, <a href="http://www.5bay.cn/tag/xmlhttp" title="xmlhttp" rel="tag">xmlhttp</a>, <a href="http://www.5bay.cn/tag/%E5%AF%B9%E8%B1%A1" title="对象" rel="tag">对象</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/eejaxeeetpit.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XMLHTTP对象封装技术</title>
		<link>http://www.5bay.cn/network-programming/xmlhttpe.html</link>
		<comments>http://www.5bay.cn/network-programming/xmlhttpe.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 16:43:39 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[JavaScript&Ajax]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xmlhttp]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[人]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[初始值]]></category>
		<category><![CDATA[区别]]></category>
		<category><![CDATA[对象]]></category>
		<category><![CDATA[属性]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[获取]]></category>
		<category><![CDATA[表单]]></category>
		<category><![CDATA[诫]]></category>
		<category><![CDATA[错误]]></category>
		<category><![CDATA[页面]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=470</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/xmlhttpe.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Ajax技术的实现主要依赖于xmlhttprequest，但我们在调用其来进行异步数据的传输时，由于xmlhttp是个短线过程（处理事件完成后就销毁）如果不对该对象进行包装处理的话，就不得不在需要调用的地方重新构建xmlhttprequest，每次调用都要写一大段的代码，实在不是个好办法。好在现在很多开源的ajax框架都提供了对xmlhttp封装的方案。这里以ajaxtags自带的prototype-1.4.0.js为母版，来看看如何将xmlhttp对象封装成一个可复用的方法。 在prototype.js中，首先定义了一个变量：Ajax var Ajax = { getTransport: function() { return Try.these( function() {return new ActiveXObject(&#8216;Msxml2.XMLHTTP&#8217;)}, function() {return new ActiveXObject(&#8216;Microsoft.XMLHTTP&#8217;)}, function() {return new XMLHttpRequest()} ) &#124;&#124; false; }, activeRequestCount: 0 } 变量返回了一个xmlhttprequest，可以看到，如果我们调用了Ajax.getTransport()，每次都会返回一个新的xmlhttprequest对象。 在Ajax变量中定义了一个基础方法Ajax.Base和该基础方法的原型（初始时，每个脚本方法默认都有个空的原型，该原型会继承Object的原型，如果我们在Object中改变了原型，则所有的脚本方法都会被改变。） 该基础方法被Ajax.Request所继承，注意的是，如果在Ajax.Request中填充了继承的原型的同名方法或变量，则会实现重载。 Ajax.Base原型中最主要的是setOptions方法，过会我们就会用到。 setOptions: function(options) { this.options = { method: &#8216;post&#8217;, asynchronous: true, parameters: ” } prototype中对request是通过定义Ajax.Request原型（Ajax.Request.prototype）来实现的。 但我们并不能直接对Ajax.Request进行调用，主要原因是Ajax.Request并没有提供一个统一处理的过程。而且我们可能需要通过request 再取得response。（试想一下，客户那边发出一条信息，都始终没与收到回复，那是会让人觉得很恼火的事~），prototype同样为我们封装好了resoponse（Ajax.Responders），但两者都是相互独立的，如何把他们进行整合呢？ 在 prototype中给我们提供了两个方案，一个是Ajax.Updater，另一个是Ajax.PeriodicalUpdater，两个共同点都是必须传入3个参数： container： response数据要传达的位置，该位置通过html标签的id进行定义，比如你要把返回的数据输出到html中的某个＜div＞中，则只要把container改成该id的值就可以了。如果找不到该container，则会发生脚本错误。 url： [...]]]></description>
			<content:encoded><![CDATA[<p>Ajax技术的实现主要依赖于xmlhttprequest，但我们在调用其来进行异步数据的传输时，由于xmlhttp是个短线过程（处理事件完成后就销毁）如果不对该对象进行包装处理的话，就不得不在需要调用的地方重新构建xmlhttprequest，每次调用都要写一大段的代码，实在不是个好办法。好在现在很多开源的ajax框架都提供了对xmlhttp封装的方案。这里以ajaxtags自带的prototype-1.4.0.js为母版，来看看如何将xmlhttp对象封装成一个可复用的方法。</p>
<p>在prototype.js中，首先定义了一个变量：<a href="http://www.5bay.cn/tag/ajax" class="st_tag internal_tag" rel="tag" title="标签 ajax 下的日志">Ajax</a><br />
var Ajax = {<br />
getTransport: function() {<br />
return Try.these(<br />
function() {return new ActiveXObject(&#8216;Msxml2.XMLHTTP&#8217;)},<br />
function() {return new ActiveXObject(&#8216;Microsoft.XMLHTTP&#8217;)},<br />
function() {return new XMLHttpRequest()}<br />
) || false;<br />
},</p>
<p>activeRequestCount: 0<br />
}</p>
<p>变量返回了一个xmlhttprequest，可以看到，如果我们调用了Ajax.getTransport()，每次都会返回一个新的xmlhttprequest对象。<br />
<span id="more-470"></span><br />
在Ajax变量中定义了一个基础方法Ajax.Base和该基础方法的原型（初始时，每个脚本方法默认都有个空的原型，该原型会继承Object的原型，如果我们在Object中改变了原型，则所有的脚本方法都会被改变。） 该基础方法被Ajax.Request所继承，注意的是，如果在Ajax.Request中填充了继承的原型的同名方法或变量，则会实现重载。</p>
<p>Ajax.Base原型中最主要的是setOptions方法，过会我们就会用到。<br />
setOptions: function(options) {<br />
this.options = {<br />
method: &#8216;post&#8217;,<br />
asynchronous: true,<br />
parameters: ”<br />
}</p>
<p>prototype中对request是通过定义Ajax.Request原型（Ajax.Request.prototype）来实现的。</p>
<p>但我们并不能直接对Ajax.Request进行调用，主要原因是Ajax.Request并没有提供一个统一处理的过程。而且我们可能需要通过request 再取得response。（试想一下，客户那边发出一条信息，都始终没与收到回复，那是会让人觉得很恼火的事~），prototype同样为我们封装好了resoponse（Ajax.Responders），但两者都是相互独立的，如何把他们进行整合呢？</p>
<p>在 prototype中给我们提供了两个方案，一个是Ajax.Updater，另一个是Ajax.PeriodicalUpdater，两个共同点都是必须传入3个参数：</p>
<p>container：</p>
<p>response数据要传达的位置，该位置通过html标签的id进行定义，比如你要把返回的数据输出到html中的某个＜div＞中，则只要把container改成该id的值就可以了。如果找不到该container，则会发生脚本错误。</p>
<p><a href="http://www.5bay.cn/tag/url" class="st_tag internal_tag" rel="tag" title="标签 url 下的日志">url</a>：</p>
<p>request请求要传递的目的地。该目的地应该是个servlet或jspservlet，因为request对象只能被servlet中的do***方法自动获取。</p>
<p>options：</p>
<p>结构应该与上面Ajax.Base定义的setOptions（）中的option结构相同，如果为空或不写，则采用 Ajax.Base定义的初始值（没有传递任何参数时使用）。</p>
<p>两者的区别在与Ajax.Updater返回给container的是完整的responseText，只有在responseText完全取得又没发生异常时才会把内容写到container里面，而PeriodicalUpdater在获取responseText时，不管是否已经完整取得，就把内容填进container，直到发生异常或完全取得responseText。大多数情况应该使用第一种方法，因为第一种方法在发生异常时会把异常信息显示在container里面，而第二种就不一定了。</p>
<p>既然已经把xmlhttp封装好了，我们只需要设置好前面所说的3个参数就可以了，要注意的是，设置options参数，一定要按照base中的options结构进行设置，如果我们使用post方法，还可以在opitons中设置postBody属性，把要传递的queryString 放到body中,一个使用post方法进行传递的脚本例子如下：</p>
<p>/*表单提交用post方法*/<br />
function doRequest(container,paraments,url){<br />
var options ={<br />
method: &#8216;post&#8217;,<br />
asynchronous: true,<br />
postBody: paraments<br />
};<br />
new Ajax.Updater(container,url,options);<br />
}</p>
<p>最后不得不说的是中文编码问题，prototype对传递的参数都进行了编码转换工作，每个传递值通过encodeURIComponent　进行了处理．编码会被转换成utf－8，在后台获取request时，应该统一使用request.setCharacterEncoding(“UTF-8&#8243;)对request设置编码，而不必管页面的编码格式是什么．如果使用post方法进行传递数据，则会自动执行:</p>
<p>request．setHeader(&#8216;Content-type&#8217;,'application/x-www-form-urlencoded&#8217;).确保传递数据编码格式的正确.</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeeeeehuai.html" title="PHP对文本数据库的基本操作方法">PHP对文本数据库的基本操作方法</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpzhongdememcachehanshukumemcachefunctions.html" title="PHP中的Memcache函数库（Memcache Functions）">PHP中的Memcache函数库（Memcache Functions）</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://www.5bay.cn/tag/code" title="code" rel="tag">code</a>, <a href="http://www.5bay.cn/tag/div" title="div" rel="tag">div</a>, <a href="http://www.5bay.cn/tag/html" title="html" rel="tag">html</a>, <a href="http://www.5bay.cn/category/network-programming/javascript-ajax" title="JavaScript&amp;Ajax" rel="tag">JavaScript&amp;Ajax</a>, <a href="http://www.5bay.cn/tag/js" title="js" rel="tag">js</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/xml" title="xml" rel="tag">xml</a>, <a href="http://www.5bay.cn/tag/xmlhttp" title="xmlhttp" rel="tag">xmlhttp</a>, <a href="http://www.5bay.cn/tag/%E4%B8%AD%E6%96%87" title="中文" rel="tag">中文</a>, <a href="http://www.5bay.cn/tag/%E4%BA%BA" title="人" rel="tag">人</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%88%9D%E5%A7%8B%E5%80%BC" title="初始值" rel="tag">初始值</a>, <a href="http://www.5bay.cn/tag/%E5%8C%BA%E5%88%AB" title="区别" rel="tag">区别</a>, <a href="http://www.5bay.cn/tag/%E5%AF%B9%E8%B1%A1" title="对象" rel="tag">对象</a>, <a href="http://www.5bay.cn/tag/%E5%B1%9E%E6%80%A7" title="属性" rel="tag">属性</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a>, <a href="http://www.5bay.cn/tag/%E8%8E%B7%E5%8F%96" title="获取" rel="tag">获取</a>, <a href="http://www.5bay.cn/tag/%E8%A1%A8%E5%8D%95" title="表单" rel="tag">表单</a>, <a href="http://www.5bay.cn/tag/e" title="诫" rel="tag">诫</a>, <a href="http://www.5bay.cn/tag/%E9%94%99%E8%AF%AF" title="错误" rel="tag">错误</a>, <a href="http://www.5bay.cn/tag/%E9%A1%B5%E9%9D%A2" title="页面" rel="tag">页面</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/xmlhttpe.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>基于JSON的高级AJAX开发技术</title>
		<link>http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html</link>
		<comments>http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 16:39:46 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[mod]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[人]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[分离]]></category>
		<category><![CDATA[对象]]></category>
		<category><![CDATA[属性]]></category>
		<category><![CDATA[应用程序]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[浏览器]]></category>
		<category><![CDATA[程序]]></category>
		<category><![CDATA[类]]></category>
		<category><![CDATA[网站]]></category>
		<category><![CDATA[自身]]></category>
		<category><![CDATA[诫]]></category>
		<category><![CDATA[链接]]></category>
		<category><![CDATA[面向对象]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=464</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>一、 引言 　　毫无疑问，AJAX已经成为当今Web开发中一种强有力的用户交互技术，但是它的许多可能性应用仍然鲜为人知。在本文中，我们将来共同探讨如何使用JavaScript对象标志(JSON)和JSON分析器在服务器和客户端AJAX引擎之间创建复杂而强有力的JSON数据传输层。我们将详细讨论如何创建一组对象(在其它语言中经常被当作一个包)，如何把这些对象串行化为JSON以发送到服务器端，以及如何把服务器端JSON反串行化为客户端JavaScript对象。 　　提示：你可以在Douglas Crockford的网站上找到本文中使用的JSON分析器。 　　在继续阅读前，本文假定你已经掌握了JavaScript技术并且了解如何创建一个基本的AJAX引擎，并经由AJAX技术向服务器端发出请求和从服务器端接收响应。为了更好地理解本文中示例，你需要下载本文相应的源码文件。 　　二、 开始 　　为了进一步抽象我们的AJAX请求并有助于我们以后在不同的应用程序间共享AJAX引擎代码，本文使用了一个我自己创建的AJAX引擎。为了使用这个引擎，我们简单地导入三个JavaScript文件并且向一个名为AjaxUpdater的对象发出请求。然后，由该引擎来负责处理其它任务，包括把响应代理到在该请求中指定的回调方法中。下面的示例展示了我们如何使用这个引擎发出请求以及导入相关的文件： ＜script type=”text/javascript”src=”javascript/model/Ajax.js”＞＜/script＞ ＜script type=”text/javascript” src=”javascript/model/HTTP.js”＞＜/script＞ ＜script type=”text/javascript” src=”javascript/model/AjaxUpdater.js”＞＜/script＞ ＜script type=”text/javascript”＞ document.load = AjaxUpdater.Update(’GET’， URL， callback); ＜/script＞ 　　首先，让我们来讨论JavaScript对象。 三、 JavaScript对象 　　JavaScript以前经常被误解，似乎它主要用于实现客户浏览器端图形效果。其实，JavaScript是一种强有力的语言，特别当它与AJAX以及一个应用程序的服务器端相结合时;但是，即使在客户端，JavaScript也能够实现远比你预料得多的多的功能。面向对象的JavaScript就是一个示例，它能够使我们创建对象，扩展内在对象，甚至能够把我们的对象创建成包以达到更容易的管理之目的。 　　在本文示例中，我们将创建三个对象：Auto，Car和Wheel。其中，每一个都是简单的对象;在此，我们仅使用它们来展示如何创建一个基本包。 　　首先，Auto对象被声明为一个新的对象： 　　var Auto = new Object(); 　　注意，这个Auto对象将用作Car对象的父类。因此，Car对象将成为Auto对象的一个属性，只不过它被分离到另一个文件中以更易于管理(这个概念经常被用于其它面向对象的语言中，但是在JavaScript中却并不经常提起它)。下面是这个Car对象相应的代码： 　　Auto.Car = new Object(); 　　Auto.Car.color = “#fff”; 　　Auto.Car.setColor = function(_color) 　　{ 　　Auto.Car.color = _color; 　　} 　　Auto.Car.setColor(“#333&#8243;); 　　如你所见，该Car对象是Auto对象的一个子对象—这分明是一种类对象层次结构。这个对象有一个名为color的属性和一个用于设置它的方法。在此，我们把color属性设置为灰色以覆盖掉缺省的白色。当在后面我们串行化该对象时请牢记住这个事实。 　　下一个对象，Wheel，是Car的一个子对象： [...]]]></description>
			<content:encoded><![CDATA[<p>一、 引言</p>
<p>　　毫无疑问，AJAX已经成为当今Web开发中一种强有力的用户交互技术，但是它的许多可能性应用仍然鲜为人知。在本文中，我们将来共同探讨如何使用JavaScript对象标志(JSON)和JSON分析器在服务器和客户端AJAX引擎之间创建复杂而强有力的JSON数据传输层。我们将详细讨论如何创建一组对象(在其它语言中经常被当作一个包)，如何把这些对象串行化为JSON以发送到服务器端，以及如何把服务器端JSON反串行化为客户端JavaScript对象。</p>
<p>　　提示：你可以在Douglas Crockford的网站上找到本文中使用的JSON分析器。</p>
<p>　　在继续阅读前，本文假定你已经掌握了JavaScript技术并且了解如何创建一个基本的AJAX引擎，并经由AJAX技术向服务器端发出请求和从服务器端接收响应。为了更好地理解本文中示例，你需要下载本文相应的源码文件。<span id="more-464"></span></p>
<p>　　二、 开始</p>
<p>　　为了进一步抽象我们的AJAX请求并有助于我们以后在不同的应用程序间共享AJAX引擎代码，本文使用了一个我自己创建的AJAX引擎。为了使用这个引擎，我们简单地导入三个JavaScript文件并且向一个名为AjaxUpdater的对象发出请求。然后，由该引擎来负责处理其它任务，包括把响应代理到在该请求中指定的回调方法中。下面的示例展示了我们如何使用这个引擎发出请求以及导入相关的文件：</p>
<p>＜script type=”text/javascript”src=”javascript/model/<a href="http://www.5bay.cn/tag/ajax" class="st_tag internal_tag" rel="tag" title="标签 ajax 下的日志">Ajax</a>.<a href="http://www.5bay.cn/tag/js" class="st_tag internal_tag" rel="tag" title="标签 js 下的日志">js</a>”＞＜/script＞<br />
＜script type=”text/javascript” src=”javascript/model/HTTP.js”＞＜/script＞<br />
＜script type=”text/javascript” src=”javascript/model/AjaxUpdater.js”＞＜/script＞<br />
＜script type=”text/javascript”＞<br />
document.load = AjaxUpdater.Update(’GET’， URL， callback);<br />
＜/script＞ </p>
<p>　　首先，让我们来讨论JavaScript对象。</p>
<p>三、 JavaScript对象 </p>
<p>　　JavaScript以前经常被误解，似乎它主要用于实现客户浏览器端图形效果。其实，JavaScript是一种强有力的语言，特别当它与AJAX以及一个应用程序的服务器端相结合时;但是，即使在客户端，JavaScript也能够实现远比你预料得多的多的功能。面向对象的JavaScript就是一个示例，它能够使我们创建对象，扩展内在对象，甚至能够把我们的对象创建成包以达到更容易的管理之目的。</p>
<p>　　在本文示例中，我们将创建三个对象：Auto，Car和Wheel。其中，每一个都是简单的对象;在此，我们仅使用它们来展示如何创建一个基本包。</p>
<p>　　首先，Auto对象被声明为一个新的对象：</p>
<p>　　var Auto = new Object(); </p>
<p>　　注意，这个Auto对象将用作Car对象的父类。因此，Car对象将成为Auto对象的一个属性，只不过它被分离到另一个文件中以更易于管理(这个概念经常被用于其它面向对象的语言中，但是在JavaScript中却并不经常提起它)。下面是这个Car对象相应的代码：</p>
<p>　　Auto.Car = new Object();<br />
　　Auto.Car.color = “#fff”;<br />
　　Auto.Car.setColor = function(_color)<br />
　　{<br />
　　Auto.Car.color = _color;<br />
　　}<br />
　　Auto.Car.setColor(“#333&#8243;); </p>
<p>　　如你所见，该Car对象是Auto对象的一个子对象—这分明是一种类对象层次结构。这个对象有一个名为color的属性和一个用于设置它的方法。在此，我们把color属性设置为灰色以覆盖掉缺省的白色。当在后面我们串行化该对象时请牢记住这个事实。</p>
<p>　　下一个对象，Wheel，是Car的一个子对象：</p>
<p>Auto.Car.Wheel = new Object();<br />
Auto.Car.Wheel.color = “#000&#8243;; </p>
<p>　　在此，Wheel是一个基本对象，但是它展示了对象层次中的又一个层。这个对象有一个称为color的缺省值为黑色(“#000”)的属性。</p>
<p>　　下面，让我们来分析一下为什么这些对象如此重要以及我们是如何使用它们提供的简单的属性的。</p>
<p>四、 把JavaScript对象串行化为JSON </p>
<p>　　借助于JSON分析器，我们可以很容易地把刚才创建的JavaScript对象串行化为JSON。首先，我们需要下载该分析器的一个副本，并且要把它添加到文档中。下面是我在本文示例中用于导入该脚本的相应的代码：</p>
<p>＜script type=”text/javascript” src=”javascript/utils/jsonparser.js”＞＜/script＞ </p>
<p>　　我已经把该分析器添加到我的javascript目录，即一个称为utils的子目录下。</p>
<p>　　下面是最终的包括到其中用于导入适当的JavaScript文件的代码片断：</p>
<p>以下是引用片段：<br />
＜script type=”text/javascript” src=”javascript/Auto.js”＞＜/script＞<br />
＜script type=”text/javascript” src=”javascript/Car.js”＞＜/script＞<br />
＜script type=”text/javascript” src=”javascript/Wheel.js”＞＜/script＞<br />
＜script type=”text/javascript” src=”javascript/utils/jsonparser.js”＞＜/script＞<br />
＜script type=”text/javascript” src=”javascript/model/Ajax.js”＞＜/script＞<br />
＜script type=”text/javascript” src=”javascript/model/HTTP.js”＞＜/script＞<br />
＜script type=”text/javascript” src=”javascript/model/AjaxUpdater.js”＞＜/script＞ </p>
<p>　　在导入适当的文件后，我们可以通过把两个div元素和一个onload事件简单地添加到HTML文档中开始串行化。这两个div元素将分别拥有ID：body和loading。其中，这个loading标签将由AJAX引擎使用来指示进度情况，而body标签将用于显示消息。</p>
<p>＜div id=”loading”＞＜/div＞<br />
＜div id=”body”＞＜/div＞ </p>
<p>　　onload事件相应于body元素并且设置它的innerHTML属性为JavaScript对象(作为一个串行化的JSON字符串)。为了实现这一目的，我在Auto对象上使用了jsonparser.js文件内的toJSONString方法：</p>
<p>＜body onload=”document.getElementById(’body’).innerHTML = ’＜b＞Local objects serialized as JSON＜/b＞<br />
Auto Object: ’+ Auto.toJSONString();”＞ </p>
<p>　　这段代码使用了Auto对象及其所有的子对象，并且使用JSON分析器的toJSONString方法把它们串行化为一个JSON字符串。然后，该数据可以被用作服务器端的一种数据交换格式。</p>
<p>　　你可能还记得，在前面我们曾调用了一个称为setColor的方法来改变Car对象的颜色。当时，我使用它是因为我想向你展示串行化能够在运行时刻的任何点上实现，而且还为了反映出对象中最新的数据。</p>
<p>　　如果你仔细分析一下onload事件，你会注意到，Car和Wheel对象都包装在方括号内，这些方括号代表了父对象(即Auto)。这意味着，该串行化的JavaScript对象能够在运行时刻被发送到服务器端以存储最新的数据，并且也可以在应用程序启动时从服务器端进行接收以便从数据库中检索多数的当前数据。最精彩的部分在于，为了创建一种“无缝”的过程，所有与服务器之间实现的数据交换都可以使用JSON技术来实现。</p>
<p>　　下面，让我们来看一下相同的数据是如何从服务器端接收的，以及它们是如何被使用最新的数据(典型地，来源于一个数据库)串行化为客户端JavaScript对象的。</p>
<p>五、 把JSON反串行化为客户端JavaScript对象 </p>
<p>　　在本文中，我简单地把一个静态文件创建为JSON响应，但是在实际开发中，你可以把这些数据存储在一个数据库中并且使用一种服务器端语言返回它。基于这一能力，我们就可以轻松地创建一种强有力的数据交换过程!在前面，我们已经分析了这一串行化过程。凭基本的AJAX体验，你应该能够理解数据是如何被寄送到服务器端的。现在，让我们着手讨论反串行化的问题。首先来看一个针对本文示例提供的静态JSON文件。这个文件其实是我们在上一节中串行化的数据：</p>
<p>}} </p>
<p>　　作为一个请求JSON文件的示例，当我们点击下列链接时将请求这个串行化的Auto对象：</p>
<p>＜a href=”javascript:AjaxUpdater.Update(’GET’， ’json/data.js’， displayResponse);”＞Get remote JSON＜/a＞ </p>
<p>　　一旦接收到响应消息，我们的称为displayResponse回调方法就会被激活，然后，我们就能够反串行化并开始使用这些对象：</p>
<p>＜script type=”text/javascript”＞<br />
function displayResponse()<br />
{<br />
　if(Ajax.checkReadyState(’loading’) == “OK”)<br />
　{<br />
　　var Auto = Ajax.request.responseText.parseJSON();<br />
　　document.getElementById(“body”).innerHTML += ”<br />
＜b＞Remote JSON unserialized＜/b＞”;<br />
　　document.getElementById(“body”).innerHTML += ”<br />
Car color: “+Auto.Car.color;<br />
　　document.getElementById(“body”).innerHTML += ”<br />
Wheel color: “+Auto.Car.Wheel.color;<br />
　}<br />
}<br />
＜/script＞ </p>
<p>　　这是相当激动人心的一部分!一旦我们拥有了该responseText，我们就能够简单地使用JSON分析器中的parseJSON方法来从串行化的数据中重建我们的Auto对象。借助于这个新的Auto对象，我们就可以调用相应的子对象。这个特征允许我们在服务器和客户端来回发送对象—而不必进行大量的分析工作，然而在以前标准的XML响应情况下我们将却必须这样做。这样以来，我们就可以创建出能够基于AJAX技术来保留自身状态的客户端JavaScript对象</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html" title="《高性能网站建设指南》读书笔记">《高性能网站建设指南》读书笔记</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://www.5bay.cn/tag/div" title="div" rel="tag">div</a>, <a href="http://www.5bay.cn/tag/html" title="html" rel="tag">html</a>, <a href="http://www.5bay.cn/tag/javascript" title="javascript" rel="tag">javascript</a>, <a href="http://www.5bay.cn/tag/js" title="js" rel="tag">js</a>, <a href="http://www.5bay.cn/tag/mod" title="mod" rel="tag">mod</a>, <a href="http://www.5bay.cn/category/network-programming/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/xml" title="xml" rel="tag">xml</a>, <a href="http://www.5bay.cn/tag/%E4%BA%BA" title="人" rel="tag">人</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%88%86%E7%A6%BB" title="分离" rel="tag">分离</a>, <a href="http://www.5bay.cn/tag/%E5%AF%B9%E8%B1%A1" title="对象" rel="tag">对象</a>, <a href="http://www.5bay.cn/tag/%E5%B1%9E%E6%80%A7" title="属性" rel="tag">属性</a>, <a href="http://www.5bay.cn/tag/%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F" title="应用程序" rel="tag">应用程序</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE%E5%BA%93" title="数据库" rel="tag">数据库</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/tag/%E6%B5%8F%E8%A7%88%E5%99%A8" title="浏览器" rel="tag">浏览器</a>, <a href="http://www.5bay.cn/tag/%E7%A8%8B%E5%BA%8F" title="程序" rel="tag">程序</a>, <a href="http://www.5bay.cn/tag/%E7%B1%BB" title="类" rel="tag">类</a>, <a href="http://www.5bay.cn/tag/%E7%BD%91%E7%AB%99" title="网站" rel="tag">网站</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a>, <a href="http://www.5bay.cn/tag/%E8%87%AA%E8%BA%AB" title="自身" rel="tag">自身</a>, <a href="http://www.5bay.cn/tag/e" title="诫" rel="tag">诫</a>, <a href="http://www.5bay.cn/tag/%E9%93%BE%E6%8E%A5" title="链接" rel="tag">链接</a>, <a href="http://www.5bay.cn/tag/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1" title="面向对象" rel="tag">面向对象</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP安全之数据过滤</title>
		<link>http://www.5bay.cn/network-programming/phpeezhanchang.html</link>
		<comments>http://www.5bay.cn/network-programming/phpeezhanchang.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 16:38:25 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[mod]]></category>
		<category><![CDATA[PHP安全]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[人]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[判断]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[程序]]></category>
		<category><![CDATA[类]]></category>
		<category><![CDATA[表单]]></category>
		<category><![CDATA[设计]]></category>
		<category><![CDATA[诫]]></category>
		<category><![CDATA[软件]]></category>
		<category><![CDATA[邮件]]></category>
		<category><![CDATA[重定向]]></category>
		<category><![CDATA[错误]]></category>
		<category><![CDATA[验证]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=462</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/phpeezhanchang.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>在指南的开始，我们说过数据过滤在任何语言、任何平台上都是WEB应用安全的基石。这包含检验输入到应用的数据以及从应用输出的数据，而一个好的软件设计可以帮助开发人员做到： 确保数据过滤无法被绕过，确保不合法的信息不会影响合法的信息，并且识别数据的来源。 关于如何确保数据过滤无法被绕过有各种各样的观点，而其中的两种观点比其他更加通用并可提供更高级别的保障。 调度方法 这种方法是用一个单一的 PHP 脚本调度（通过 URL）。其他任何操作在必要的时候使用include或require包含进来。这种方法一般需要每个 URL 都传递一个单独的GET变量用于调度。这个GET变量可以被认为是用来替代脚本名称的更加简化的设计。例如： http://example.org/dispatch.php?task=print_formdispatch.php是唯一的根文件(Document root)。它可以让开发者做两件非常重要的事情： 在dispatch.php最开始实现一些全局的安全处理，并且确保这些处理不可以被绕过。 容易确定在必要的地方进行数据过滤，特别是一些特殊目的的控制流操作中。 看下面的例子以便进一步讨论dispatch.php脚本: 如果这是唯一的可公开访问到的 PHP 脚本，则可以确信的一点是这个程序的设计可以确保在最开始的全局安全处理无法被绕过。同时也让开发者容易看到特定任务的控制流程。例如，不需要浏览整个代码就可以容易的知道：当$form_valid为true时，end.inc是唯一显示给用户的；由于它在process.inc被包含之前，并刚刚初始化为false，可以确定的是process.inc的内部逻辑会将设置它为true；否则表单将再次显示（可能会显示相关的错误信息）。 注意 如果你使用目录定向文件，如index.php（代替dispatch.php），你可以像这样使用 URL 地址：http://example.org/?task=print_form。 你还可以使用 ApacheForceType重定向或者mod_rewrite来调整 URL 地址：http://example.org/app/print-form。 包含方法 另外一种方式是使用单独一个模块，这个模块负责所有的安全处理。这个模块被包含在所有公开的 PHP 脚本的最前端（或者非常靠前的部分）。参考下面的脚本security.inc 在本例中，每个提交过来的表单都认为应当含有form这个唯一验证值，并且security.inc独立处理表单中0需要过滤的数据。实现这个要求的 HTML 表单如下所示： Username: Password: 叫做$allowed的数组用来检验哪个表单变量是允许的， 这个列表在表单被处理前应当是一致的。流程控制决定要执行什么，而process.inc是真正过滤后的数据到达的地方。 注意 确保security.inc总是被包含在每个脚本的最开始的位置比较好的方法是使用auto_prepend_file设置。 过滤的例子 建立白名单对于数据过滤是非常重要的。由于不可能对每一种可能遇到的表单数据都给出例子，部分例子可以帮助你对此有一个大体的了解。 下面的代码对邮件地址进行了验证：]]></description>
			<content:encoded><![CDATA[<p>在指南的开始，我们说过数据过滤在任何语言、任何平台上都是WEB应用安全的基石。这包含检验输入到应用的数据以及从应用输出的数据，而一个好的软件设计可以帮助开发人员做到：</p>
<p>确保数据过滤无法被绕过，确保不合法的信息不会影响合法的信息，并且识别数据的来源。</p>
<p>关于如何确保数据过滤无法被绕过有各种各样的观点，而其中的两种观点比其他更加通用并可提供更高级别的保障。<br />
<span id="more-462"></span><br />
调度方法</p>
<p>这种方法是用一个单一的 PHP 脚本调度（通过 URL）。其他任何操作在必要的时候使用include或require包含进来。这种方法一般需要每个 URL 都传递一个单独的GET变量用于调度。这个GET变量可以被认为是用来替代脚本名称的更加简化的设计。例如：</p>
<p>http://example.org/dispatch.php?task=print_formdispatch.php是唯一的根文件(Document root)。它可以让开发者做两件非常重要的事情：</p>
<p>在dispatch.php最开始实现一些全局的安全处理，并且确保这些处理不可以被绕过。</p>
<p>容易确定在必要的地方进行数据过滤，特别是一些特殊目的的控制流操作中。</p>
<p>看下面的例子以便进一步讨论dispatch.php脚本:</p>
<p><?php/* 全局安全处理 */switch ($_GET['task']){case 'print_form':include '/inc/presentation/form.inc';break;case 'process_form':$form_valid = false;include '/inc/logic/process.inc';if ($form_valid){include '/inc/presentation/end.inc';}else{include '/inc/presentation/form.inc';}break;default:include '/inc/presentation/index.inc';break;}?></p>
<p>如果这是唯一的可公开访问到的 PHP 脚本，则可以确信的一点是这个程序的设计可以确保在最开始的全局安全处理无法被绕过。同时也让开发者容易看到特定任务的控制流程。例如，不需要浏览整个代码就可以容易的知道：当$form_valid为true时，end.inc是唯一显示给用户的；由于它在process.inc被包含之前，并刚刚初始化为false，可以确定的是process.inc的内部逻辑会将设置它为true；否则表单将再次显示（可能会显示相关的错误信息）。</p>
<p>注意</p>
<p>如果你使用目录定向文件，如index.php（代替dispatch.php），你可以像这样使用 URL 地址：http://example.org/?task=print_form。</p>
<p>你还可以使用 ApacheForceType重定向或者mod_rewrite来调整 URL 地址：http://example.org/app/print-form。</p>
<p>包含方法</p>
<p>另外一种方式是使用单独一个模块，这个模块负责所有的安全处理。这个模块被包含在所有公开的 PHP 脚本的最前端（或者非常靠前的部分）。参考下面的脚本security.inc</p>
<p><?phpswitch ($_POST['form']){case 'login':$allowed = array();$allowed[] = 'form';$allowed[] = 'username';$allowed[] = 'password';$sent = array_keys($_POST);if ($allowed == $sent){include '/inc/logic/process.inc';}break;}?>在本例中，每个提交过来的表单都认为应当含有form这个唯一验证值，并且security.inc独立处理表单中0需要过滤的数据。实现这个要求的 HTML 表单如下所示：</p>
<form action="/receive.php" method="POST">
<input type="hidden" name="form" value="login" />
<p>Username:<br />
<input type="text" name="username" /></p>
<p>Password:<br />
<input type="password" name="password" /></p>
<input type="submit" /></form>
<p>叫做$allowed的数组用来检验哪个表单变量是允许的， 这个列表在表单被处理前应当是一致的。流程控制决定要执行什么，而process.inc是真正过滤后的数据到达的地方。</p>
<p>注意</p>
<p>确保security.inc总是被包含在每个脚本的最开始的位置比较好的方法是使用auto_prepend_file设置。</p>
<p>过滤的例子</p>
<p>建立白名单对于数据过滤是非常重要的。由于不可能对每一种可能遇到的表单数据都给出例子，部分例子可以帮助你对此有一个大体的了解。</p>
<p>下面的代码对邮件地址进行了验证：</p>
<p><?php$clean = array();$email_pattern = '/^[^@\s<&#038;>]+@([-a-z0-9]+\.)+[a-z]{2,}$/i&#8217;;if (preg_match($email_pattern, $_POST['email'])){$clean['email'] = $_POST['email'];}?>下面的代码确保了$_POST['color']的内容是red，green，或者blue：</p>
<p><?php$clean = array();switch ($_POST['color']){case 'red':case 'green':case 'blue':$clean['color'] = $_POST['color'];break;}?>下面的代码确保$_POST['num']是一个整数（integer）：</p>
<p><?php$clean = array();if ($_POST['num'] == strval(intval($_POST['num']))){$clean['num'] = $_POST['num'];}?>下面的代码确保$_POST['num']是一个浮点数（float）：</p>
<p><?php$clean = array();if ($_POST['num'] == strval(floatval($_POST['num']))){$clean['num'] = $_POST['num'];}?>名字转换<br />
之前每个例子都使用了数组$clean。对于开发人员判断数据是否有潜在的威胁这是一个很好的习惯。 永远不要在对数据验证后还将其保存在$_POST或者$_GET中，作为开发人员对超级全局数组中保存的数据总是应当保持充分的怀疑。</p>
<p>需要补充的是，使用$clean可以帮助思考还有什么没有被过滤，这更类似一个白名单的作用。可以提升安全的等级。</p>
<p>如果仅仅将验证过的数据保存在$clean，在数据验证上仅存的风险是你所引用的数组元素不存在，而不是未过滤的危险数据。</p>
<p>时机</p>
<p>一旦 PHP 脚本开始执行，则意味着 HTTP 请求已经全部结束。此时，用户便没有机会向脚本发送数据。因此，没有数据可以被输入到脚本中（甚至register_globals被开启的情况下）。这就是为什么初始化变量是非常好的习惯。</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeeeeehuai.html" title="PHP对文本数据库的基本操作方法">PHP对文本数据库的基本操作方法</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/html" title="html" rel="tag">html</a>, <a href="http://www.5bay.cn/tag/include" title="include" rel="tag">include</a>, <a href="http://www.5bay.cn/tag/mod" title="mod" rel="tag">mod</a>, <a href="http://www.5bay.cn/category/network-programming/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/phpaa" title="PHP安全" rel="tag">PHP安全</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/%E4%BA%BA" title="人" rel="tag">人</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%88%A4%E6%96%AD" title="判断" rel="tag">判断</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/tag/%E7%A8%8B%E5%BA%8F" title="程序" rel="tag">程序</a>, <a href="http://www.5bay.cn/tag/%E7%B1%BB" title="类" rel="tag">类</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a>, <a href="http://www.5bay.cn/tag/%E8%A1%A8%E5%8D%95" title="表单" rel="tag">表单</a>, <a href="http://www.5bay.cn/tag/%E8%AE%BE%E8%AE%A1" title="设计" rel="tag">设计</a>, <a href="http://www.5bay.cn/tag/e" title="诫" rel="tag">诫</a>, <a href="http://www.5bay.cn/tag/%E8%BD%AF%E4%BB%B6" title="软件" rel="tag">软件</a>, <a href="http://www.5bay.cn/tag/%E9%82%AE%E4%BB%B6" title="邮件" rel="tag">邮件</a>, <a href="http://www.5bay.cn/tag/%E9%87%8D%E5%AE%9A%E5%90%91" title="重定向" rel="tag">重定向</a>, <a href="http://www.5bay.cn/tag/%E9%94%99%E8%AF%AF" title="错误" rel="tag">错误</a>, <a href="http://www.5bay.cn/tag/%e9%aa%8c%e8%af%81" title="验证" rel="tag">验证</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/phpeezhanchang.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP封装常用Javascript为JS类以便快速调用</title>
		<link>http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html</link>
		<comments>http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html#comments</comments>
		<pubDate>Sat, 22 May 2010 21:32:51 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[JavaScript&Ajax]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[常用]]></category>
		<category><![CDATA[提交表单]]></category>
		<category><![CDATA[数据]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[类]]></category>
		<category><![CDATA[表]]></category>
		<category><![CDATA[表单]]></category>
		<category><![CDATA[连接]]></category>
		<category><![CDATA[页面]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=377</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>&#60;?php # $Id: js.class.php,v 0.1 p $ // 禁止直接访问该页面 if (basename($HTTP_SERVER_VARS['PHP_SELF']) == &#34;js.class.php&#34;) { &#160;&#160;&#160;&#160; header(&#34;HTTP/1.0 404 Not Found&#34;); } # Purpose 封装了一些常用的Javascript代码，以便在PHP中快速调用 class JS{ &#160;&#160;&#160;&#160; function JS(){} &#160;&#160;&#160;&#160; #返回上页 &#160;&#160;&#160;&#160; # @param $step 返回的层数 默认为1 &#160;&#160;&#160;&#160; function Back($step = -1){ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $msg = &#34;history.go(&#34;.$step.&#34;);&#34;; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; JS::_Write($msg); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; JS::FreeResource(); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; exit; &#160;&#160;&#160;&#160; } &#160;&#160;&#160; # [...]]]></description>
			<content:encoded><![CDATA[<p>&lt;?<a href="http://www.5bay.cn/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a><br />
# $Id: <a href="http://www.5bay.cn/tag/js" class="st_tag internal_tag" rel="tag" title="标签 js 下的日志">js</a>.class.php,v 0.1 p $</p>
<p>// 禁止直接访问该页面<br />
if (basename($HTTP_<a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">SERVER</a>_VARS['PHP_SELF']) == &quot;js.class.php&quot;) {<br />
&nbsp;&nbsp;&nbsp;&nbsp; header(&quot;HTTP/1.0 404 Not Found&quot;);<br />
}</p>
<p># Purpose 封装了一些常用的Javascript代码，以便在PHP中快速调用</p>
<p>class JS{<br />
&nbsp;&nbsp;&nbsp;&nbsp; function JS(){}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; #返回上页<br />
&nbsp;&nbsp;&nbsp;&nbsp; # @param $step 返回的层数 默认为1<br />
&nbsp;&nbsp;&nbsp;&nbsp; function Back($step = -1){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $msg = &quot;history.go(&quot;.$step.&quot;);&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::_Write($msg);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::FreeResource();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br />
&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; # 弹出警告的窗口<br />
&nbsp;&nbsp;&nbsp; # @param $msg 警告信息<br />
&nbsp;&nbsp;&nbsp;&nbsp; function Alert($msg){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $msg = &quot;alert(\&quot;&quot;.$msg.&quot;\&quot;);&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::_Write($msg);<br />
&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; # 写js<br />
&nbsp;&nbsp;&nbsp; # @param $msg<br />
&nbsp;&nbsp;&nbsp;&nbsp; function _Write($msg) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;&lt;script language=\&quot;<a href="http://www.5bay.cn/tag/javascript" class="st_tag internal_tag" rel="tag" title="标签 javascript 下的日志">javascript</a>\&quot;&gt;\n&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo $msg;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;\n&lt;/SCRIPT&gt;&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; # 刷新当前页<br />
&nbsp;&nbsp;&nbsp;&nbsp; function Reload(){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $msg = &quot;location.reload();&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::FreeResource();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::_Write($msg);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br />
&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; #刷新弹出父页<br />
&nbsp;&nbsp;&nbsp;&nbsp; function ReloadOpener(){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $msg = &quot;if (opener)&nbsp;&nbsp;&nbsp;&nbsp; opener.location.reload();&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::_Write($msg);<br />
&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; #跳转到url<br />
&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:#@param">#@param</a> $<a href="http://www.5bay.cn/tag/url" class="st_tag internal_tag" rel="tag" title="标签 url 下的日志">url</a> 目标页<br />
&nbsp;&nbsp;&nbsp;&nbsp; function Goto($url){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $msg = &quot;location.href = &#8216;$url&#8217;;&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::FreeResource();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::_Write($msg);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br />
&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; #关闭窗口<br />
&nbsp;&nbsp;&nbsp;&nbsp; function Close(){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $msg = &quot;window.close()&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::FreeResource();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::_Write($msg);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br />
&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; #提交表单<br />
&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:#@param">#@param</a> $frm 表单名<br />
&nbsp;&nbsp;&nbsp;&nbsp; function Submit($frm){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $msg = $frm.&quot;.submit();&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JS::_Write($msg);<br />
&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; #关闭数据库连接<br />
&nbsp;&nbsp;&nbsp; function FreeResource(){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 数据库连接标志<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; global $conn;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (is_resource($conn))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @<a href="http://www.5bay.cn/tag/mysql" class="st_tag internal_tag" rel="tag" title="标签 mysql 下的日志">mysql</a>_close($conn);<br />
&nbsp;&nbsp;&nbsp;&nbsp; }<br />
}<br />
?&gt;</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeeeeehuai.html" title="PHP对文本数据库的基本操作方法">PHP对文本数据库的基本操作方法</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/eacceleratoryumemcachedequbieyuyongtu.html" title="eAccelerator与memcache的区别与用途">eAccelerator与memcache的区别与用途</a> (2)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpzhongdememcachehanshukumemcachefunctions.html" title="PHP中的Memcache函数库（Memcache Functions）">PHP中的Memcache函数库（Memcache Functions）</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/class" title="class" rel="tag">class</a>, <a href="http://www.5bay.cn/tag/javascript" title="javascript" rel="tag">javascript</a>, <a href="http://www.5bay.cn/category/network-programming/javascript-ajax" title="JavaScript&amp;Ajax" rel="tag">JavaScript&amp;Ajax</a>, <a href="http://www.5bay.cn/tag/js" title="js" rel="tag">js</a>, <a href="http://www.5bay.cn/tag/mysql" title="mysql" rel="tag">mysql</a>, <a href="http://www.5bay.cn/category/network-programming/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/server" title="server" rel="tag">server</a>, <a href="http://www.5bay.cn/tag/sql" title="sql" rel="tag">sql</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%B8%B8%E7%94%A8" title="常用" rel="tag">常用</a>, <a href="http://www.5bay.cn/tag/%E6%8F%90%E4%BA%A4%E8%A1%A8%E5%8D%95" title="提交表单" rel="tag">提交表单</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE" title="数据" rel="tag">数据</a>, <a href="http://www.5bay.cn/tag/%E6%95%B0%E6%8D%AE%E5%BA%93" title="数据库" rel="tag">数据库</a>, <a href="http://www.5bay.cn/tag/%E7%B1%BB" title="类" rel="tag">类</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a>, <a href="http://www.5bay.cn/tag/%E8%A1%A8" title="表" rel="tag">表</a>, <a href="http://www.5bay.cn/tag/%E8%A1%A8%E5%8D%95" title="表单" rel="tag">表单</a>, <a href="http://www.5bay.cn/tag/%E8%BF%9E%E6%8E%A5" title="连接" rel="tag">连接</a>, <a href="http://www.5bay.cn/tag/%E9%A1%B5%E9%9D%A2" title="页面" rel="tag">页面</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>图片轮换类，IE7、OP、FF、Chrome测试通过</title>
		<link>http://www.5bay.cn/network-programming/tupianlunhuanleiie7opffchromeceshitongguo.html</link>
		<comments>http://www.5bay.cn/network-programming/tupianlunhuanleiie7opffchromeceshitongguo.html#comments</comments>
		<pubDate>Sat, 22 May 2010 21:22:44 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[JavaScript&Ajax]]></category>
		<category><![CDATA[网络编程]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mod]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[title]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[类]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=367</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/tupianlunhuanleiie7opffchromeceshitongguo.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>&#60;html&#62; &#60;head&#62;&#60;title&#62;新闻图片轮换类&#60;/title&#62; &#60;script type=&#8221;text/javascript&#8221;&#62; var fs = new FadeSlideClass(); fs.Width = 430; fs.Height = 250; fs.AddImage(&#8220;http://www.5bay.cn/Test/Image/001.jpg&#8220;, &#8220;#&#8221;, &#8220;新闻标题&#8221;); fs.AddImage(&#8220;http://www.5bay.cn/Test/Image/002.jpg&#8220;, &#8220;#&#8221;, &#8220;新闻标题&#8221;); fs.AddImage(&#8220;http://www.5bay.cn/Test/Image/003.jpg&#8220;, &#8220;//g.cn&#8221;, &#8220;去Google&#8221;); fs.AddImage(&#8220;http://www.5bay.cn/Test/Image/004.jpg&#8220;, &#8220;#&#8221;, &#8220;新闻标题&#8221;); fs.AddImage(&#8220;http://www.5bay.cn/Test/Image/005.jpg&#8220;, &#8220;#&#8221;, &#8220;新闻标题&#8221;); fs.RenderTo(&#8220;divStage&#8221;); /* 以下代码构造轮换类 */ function FadeSlideClass() { this.Width = 450; this.Height = 300; this.BorderColor = &#8220;#ddd&#8221;; this.CurrentColor = &#8220;green&#8221;; this.Delay = 5000; var divContainer = [...]]]></description>
			<content:encoded><![CDATA[<p>&lt;html&gt;<br />
&lt;head&gt;&lt;<a href="http://www.5bay.cn/tag/title" class="st_tag internal_tag" rel="tag" title="标签 title 下的日志">title</a>&gt;新闻图片轮换类&lt;/<a href="http://www.5bay.cn/tag/title" class="st_tag internal_tag" rel="tag" title="标签 title 下的日志">title</a>&gt;<br />
&lt;script type=&rdquo;text/<a href="http://www.5bay.cn/tag/javascript" class="st_tag internal_tag" rel="tag" title="标签 javascript 下的日志">javascript</a>&rdquo;&gt;<br />
var fs = new FadeSlideClass();<br />
fs.Width = 430;<br />
fs.Height = 250;<br />
fs.AddImage(&ldquo;<a href="http://www.5bay.cn/Test/Image/001.jpg">http://www.5bay.cn/Test/Image/001.jpg</a>&ldquo;, &ldquo;#&rdquo;, &ldquo;新闻标题&rdquo;);<br />
fs.AddImage(&ldquo;<a href="http://www.5bay.cn/Test/Image/002.jpg">http://www.5bay.cn/Test/Image/002.jpg</a>&ldquo;, &ldquo;#&rdquo;, &ldquo;新闻标题&rdquo;);<br />
fs.AddImage(&ldquo;<a href="http://www.5bay.cn/Test/Image/003.jpg">http://www.5bay.cn/Test/Image/003.jpg</a>&ldquo;, &ldquo;//g.cn&rdquo;, &ldquo;去Google&rdquo;);<br />
fs.AddImage(&ldquo;<a href="http://www.5bay.cn/Test/Image/004.jpg">http://www.5bay.cn/Test/Image/004.jpg</a>&ldquo;, &ldquo;#&rdquo;, &ldquo;新闻标题&rdquo;);<br />
fs.AddImage(&ldquo;<a href="http://www.5bay.cn/Test/Image/005.jpg">http://www.5bay.cn/Test/Image/005.jpg</a>&ldquo;, &ldquo;#&rdquo;, &ldquo;新闻标题&rdquo;);<br />
fs.RenderTo(&ldquo;divStage&rdquo;);</p>
<p>/* 以下代码构造轮换类 */<br />
function FadeSlideClass()<br />
{<br />
this.Width = 450;<br />
this.Height = 300;<br />
this.BorderColor = &ldquo;#ddd&rdquo;;<br />
this.CurrentColor = &ldquo;green&rdquo;;<br />
this.Delay = 5000;<br />
var divContainer = document.createElement(&ldquo;div&rdquo;);<br />
var divImage = document.createElement(&ldquo;div&rdquo;);<br />
var ulList = document.createElement(&ldquo;ul&rdquo;);<br />
var me = this;<br />
var arrImg = new Array;<br />
this.Tag = divContainer;<br />
this.AddImage = function(strImageUrl, strLink, strTitle)<br />
{<br />
&nbsp;&nbsp; arrImg.push(arguments);<br />
}<br />
this.RenderTo = function(container)<br />
{<br />
&nbsp;&nbsp; if(typeof container == &ldquo;string&rdquo;) container = document.getElementById(container) || container;<br />
&nbsp;&nbsp; if(typeof container == &ldquo;string&rdquo;) return setTimeout(function(){ me.RenderTo(container); }, 100);<br />
&nbsp;&nbsp; if(!arrImg.length) throw new Error(&ldquo;尚未添加图片。&rdquo;);<br />
&nbsp;&nbsp; var cssFloat = typeof ulList.style.cssFloat == &ldquo;string&rdquo; ? &ldquo;cssFloat&rdquo; : &ldquo;styleFloat&rdquo;;<br />
&nbsp;&nbsp; divContainer.style.width = this.Width + &ldquo;px&rdquo;;<br />
&nbsp;&nbsp; divContainer.style.height = this.Height + &ldquo;px&rdquo;;<br />
&nbsp;&nbsp; divImage.style.width = Math.round(this.Width * (arrImg.length &ndash; 1) / arrImg.length) + &ldquo;px&rdquo;;<br />
&nbsp;&nbsp; divImage.style.height = this.Height + &ldquo;px&rdquo;;<br />
&nbsp;&nbsp; divImage.style[cssFloat] = &ldquo;left&rdquo;;<br />
&nbsp;&nbsp; ulList.style.width = (this.Width &ndash; parseInt(divImage.style.width)) + &ldquo;px&rdquo;;<br />
&nbsp;&nbsp; ulList.style.height = this.Height + &ldquo;px&rdquo;;<br />
&nbsp;&nbsp; ulList.style.margin = &ldquo;0px&rdquo;;<br />
&nbsp;&nbsp; ulList.style.padding = &ldquo;0px&rdquo;;<br />
&nbsp;&nbsp; ulList.style[cssFloat] = &ldquo;left&rdquo;;<br />
&nbsp;&nbsp; divContainer.style.overflow = &ldquo;hidden&rdquo;;<br />
&nbsp;&nbsp; divImage.style.overflow = &ldquo;hidden&rdquo;;<br />
&nbsp;&nbsp; ulList.onmouseover = function(){ clearTimeout(me.Handler) };<br />
&nbsp;&nbsp; ulList.onmouseout = function(){ AutoPlay(); };<br />
&nbsp;&nbsp; InitImage(2);<br />
&nbsp;&nbsp; InitList(arrImg.length);<br />
&nbsp;&nbsp; container.appendChild(divContainer);<br />
&nbsp;&nbsp; divContainer.appendChild(divImage);<br />
&nbsp;&nbsp; divContainer.appendChild(ulList);<br />
&nbsp;&nbsp; LiMouseOver.call(ulList.firstChild);<br />
&nbsp;&nbsp; AutoPlay();<br />
&nbsp;&nbsp; this.AddImage = function(){ throw new Error(&ldquo;该方法已过时。&rdquo;); }<br />
}<br />
this.Display = function(imgThumb)<br />
{<br />
&nbsp;&nbsp; var img = divImage.lastChild.lastChild;<br />
&nbsp;&nbsp; var opa = new OpacityClass(img);<br />
&nbsp;&nbsp; opa.Set(20);<br />
&nbsp;&nbsp; img.src = imgThumb.src;<br />
&nbsp;&nbsp; img.parentNode.href = imgThumb.parentNode.href;<br />
&nbsp;&nbsp; img.parentNode.title = imgThumb.parentNode.title;<br />
&nbsp;&nbsp; clearInterval(ulList.Handler);<br />
&nbsp;&nbsp; ulList.Handler = setInterval(function(){<br />
&nbsp;&nbsp;&nbsp; if(opa.Add(5) &gt;= 100)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp; divImage.firstChild.lastChild.src = img.src;<br />
&nbsp;&nbsp;&nbsp;&nbsp; clearInterval(ulList.Handler);<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp; }, 25);<br />
}<br />
function LiMouseOver()<br />
{<br />
&nbsp;&nbsp; if(this == ulList.oldLi) return;<br />
&nbsp;&nbsp; if(ulList.oldLi) ulList.oldLi.style.borderColor = me.BorderColor;<br />
&nbsp;&nbsp; this.style.borderColor = me.CurrentColor;<br />
&nbsp;&nbsp; ulList.oldLi = this;<br />
&nbsp;&nbsp; me.Display(this.firstChild.firstChild);<br />
}<br />
function InitImage(count)<br />
{<br />
&nbsp;&nbsp; if(&ndash;count) arguments.callee(count);<br />
&nbsp;&nbsp; var a = document.createElement(&ldquo;a&rdquo;);<br />
&nbsp;&nbsp; a.target = &ldquo;_blank&rdquo;;<br />
&nbsp;&nbsp; divImage.appendChild(a).style.position = &ldquo;absolute&rdquo;;<br />
&nbsp;&nbsp; var img = new Image;<br />
&nbsp;&nbsp; img.width = parseInt(divImage.style.width);<br />
&nbsp;&nbsp; img.height = me.Height;<br />
&nbsp;&nbsp; img.border = 0;<br />
&nbsp;&nbsp; if(!a.appendChild(img).filters) img.style.opacity = 1;<br />
&nbsp;&nbsp; else img.style.filter = &ldquo;alpha(opacity=100)&rdquo;;<br />
}<br />
function InitList(count)<br />
{<br />
&nbsp;&nbsp; if(&ndash;count) InitList(count);<br />
&nbsp;&nbsp; var isIeNoDtd = document.compatMode != &ldquo;<a href="http://www.5bay.cn/tag/css" class="st_tag internal_tag" rel="tag" title="标签 css 下的日志">CSS</a>1Compat&rdquo; &amp;&amp; /msie/i.test(navigator.userAgent);<br />
&nbsp;&nbsp; var data = arrImg[count];<br />
&nbsp;&nbsp; var thumbWidth = parseInt(ulList.style.width);<br />
&nbsp;&nbsp; var thumbHeight = Math.round(me.Height / arrImg.length);<br />
&nbsp;&nbsp; var li = document.createElement(&ldquo;li&rdquo;);<br />
&nbsp;&nbsp; li.style.overflow = &ldquo;hidden&rdquo;;<br />
&nbsp;&nbsp; li.style.width = (isIeNoDtd ? thumbWidth : thumbWidth &ndash; 4) + &ldquo;px&rdquo;;<br />
&nbsp;&nbsp; li.style.height = (isIeNoDtd ? thumbHeight : thumbHeight &ndash; 4) + &ldquo;px&rdquo;;<br />
&nbsp;&nbsp; li.style.borderWidth = &ldquo;2px&rdquo;;<br />
&nbsp;&nbsp; li.style.borderStyle = &ldquo;solid&rdquo;;<br />
&nbsp;&nbsp; li.style.borderColor = me.BorderColor;<br />
&nbsp;&nbsp; var a = document.createElement(&ldquo;a&rdquo;);<br />
&nbsp;&nbsp; a.target = &ldquo;_target&rdquo;;<br />
&nbsp;&nbsp; a.href = data[1];<br />
&nbsp;&nbsp; a.title = data[2];<br />
&nbsp;&nbsp; var img = new Image;<br />
&nbsp;&nbsp; img.border = 0;<br />
&nbsp;&nbsp; img.width = thumbWidth;<br />
&nbsp;&nbsp; img.height = thumbHeight;<br />
&nbsp;&nbsp; img.src = data[0];<br />
&nbsp;&nbsp; img.style.verticalAlign = &ldquo;top&rdquo;;<br />
&nbsp;&nbsp; img.style.margin = &ldquo;-2px&rdquo;;<br />
&nbsp;&nbsp; a.appendChild(img);<br />
&nbsp;&nbsp; li.appendChild(a);<br />
&nbsp;&nbsp; li.style.listStyle = &ldquo;none&rdquo;;<br />
&nbsp;&nbsp; li.onmouseover = LiMouseOver;<br />
&nbsp;&nbsp; ulList.appendChild(li);<br />
}<br />
function AutoPlay()<br />
{<br />
&nbsp;&nbsp; me.Handler = setTimeout(function()<br />
&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp; LiMouseOver.call(ulList.oldLi.nextSibling || ulList.firstChild);<br />
&nbsp;&nbsp;&nbsp; AutoPlay();<br />
&nbsp;&nbsp; }, me.Delay);<br />
}<br />
function OpacityClass(tag)<br />
{<br />
&nbsp;&nbsp; var isFilter = !!tag.filters;<br />
&nbsp;&nbsp; var obj = isFilter ? tag.filters.alpha : tag.style;<br />
&nbsp;&nbsp; this.Set = function(value)<br />
&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp; obj.opacity = isFilter ? value : value / 100;<br />
&nbsp;&nbsp;&nbsp; return this;<br />
&nbsp;&nbsp; }<br />
&nbsp;&nbsp; this.Add = function(value)<br />
&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp; var opa = isFilter ? obj.opacity : obj.opacity * 100;<br />
&nbsp;&nbsp;&nbsp; opa += value;<br />
&nbsp;&nbsp;&nbsp; if(opa &gt; 100) opa = 100;<br />
&nbsp;&nbsp;&nbsp; obj.opacity = isFilter ? opa : opa / 100;<br />
&nbsp;&nbsp;&nbsp; return this;<br />
&nbsp;&nbsp; }<br />
&nbsp;&nbsp; this.valueOf = function()<br />
&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp; return isFilter ? obj.opacity : obj.opacity * 100;<br />
&nbsp;&nbsp; }<br />
}<br />
}<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div id=&rdquo;divStage&rdquo;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/android%e7%ac%94%e8%ae%b0/zaiandroidzhongchuangjianqidongjiemian.html" title="在Android中创建启动界面">在Android中创建启动界面</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年08月17日 -- <a href="http://www.5bay.cn/server-building/nginxxiansu.html" title="Nginx限速">Nginx限速</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月22日 -- <a href="http://www.5bay.cn/me/csseeeeyao.html" title="CSS 中的太极拳口诀">CSS 中的太极拳口诀</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/class" title="class" rel="tag">class</a>, <a href="http://www.5bay.cn/tag/css" title="css" rel="tag">css</a>, <a href="http://www.5bay.cn/tag/div" title="div" rel="tag">div</a>, <a href="http://www.5bay.cn/tag/google" title="google" rel="tag">google</a>, <a href="http://www.5bay.cn/tag/html" title="html" rel="tag">html</a>, <a href="http://www.5bay.cn/tag/ie" title="ie" rel="tag">ie</a>, <a href="http://www.5bay.cn/tag/javascript" title="javascript" rel="tag">javascript</a>, <a href="http://www.5bay.cn/category/network-programming/javascript-ajax" title="JavaScript&amp;Ajax" rel="tag">JavaScript&amp;Ajax</a>, <a href="http://www.5bay.cn/tag/mod" title="mod" rel="tag">mod</a>, <a href="http://www.5bay.cn/tag/seo" title="seo" rel="tag">seo</a>, <a href="http://www.5bay.cn/tag/title" title="title" rel="tag">title</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%9B%BE%E7%89%87" title="图片" rel="tag">图片</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/tag/%E7%B1%BB" title="类" rel="tag">类</a>, <a href="http://www.5bay.cn/category/network-programming" title="网络编程" rel="tag">网络编程</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/tupianlunhuanleiie7opffchromeceshitongguo.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>《高性能网站建设指南》读书笔记</title>
		<link>http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html</link>
		<comments>http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html#comments</comments>
		<pubDate>Sat, 22 May 2010 21:06:26 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[服务器构建&安全]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[中国特色]]></category>
		<category><![CDATA[人]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[更新]]></category>
		<category><![CDATA[浏览器]]></category>
		<category><![CDATA[组件]]></category>
		<category><![CDATA[网站]]></category>
		<category><![CDATA[表]]></category>
		<category><![CDATA[解决]]></category>
		<category><![CDATA[设计]]></category>
		<category><![CDATA[重定向]]></category>
		<category><![CDATA[页面]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=346</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>规则1，减少HTTP请求 这是最重要的原则，如果14条规则里只能选一条，那就是它了。可以通过多种方法减少HTTP请求，例如合并图片，合并JS和CSS等等。这一点薄荷网有很多改进的余地，首先应该把现在的JS合并了。 规则2，使用内容发布网络 内容发布网络就是CDN了，但是CDN似乎挺贵的，目前还不适合薄荷网，不过可以考虑自己弄一个网通的静态资源服务器解决有中国特色的可恶的南北互通问题。 规则3，添加Expires头 这个没什么好说的，是个建网站的人都应该知道。目前薄荷网图片,css,js,flash过期时间设置了3年，可以说是永久了，：） Expires有个麻烦的地方是内容更新问题，Ruby on Rails这方面处理的非常棒，它是在文件名后面自动带了 资源文件的timestamp，完美解决。 规则4，压缩组件 这个也没什么好说的，配置一下web server的压缩功能，减少服务器带宽，加快响应，立杆见影。 规则5，将样式表放在顶部 这条有点新鲜，虽然平常都是这么做的，但是没有想过不这样做有什么麻烦。如果不这样，浏览器是不能做到边下载边显示，用户体验很糟糕。薄荷网现在有部分样式没放在顶部，回头检查测试一下看看。 规则6，将脚本放在底部 这条是第一次听说，有些震惊。原因在于浏览器下载执行脚本的时候，会阻塞其他资源的下载，这样导致整体响应时间变长。薄荷网的脚本几乎都是放在顶部的，回头测试比较下看看。 规则7，避免CSS表达式 CSS表达是简直像个Bug，可以弃用，寻求变通的解决方便，比如事件处理器等。 规则8，使用外部的JavaScript和CSS 相信大家大部分情形下都是使用外联的，但纯粹的处理而已，内联JS和CSS似乎更快，考虑到缓存和复用，大部分情况显然是外联更划算。因此，在一些情景，例如首页，还是可以使用内联的。 规则9，减少DNS查找 DNS耗费的时间是相当可观的，因此同一页面的域名数量最好控制在2~4之间。 规则10，精简JavaScript 精简JavaScript可以显著减少Js文件的大小，减少下载时间。 规则11，避免重定向 get的重定向可以通过web server的url rewrite很好解决。 规则12，移除重复脚本 重复的脚本既增加一次http请求，又要重复执行，当然坚决移除了。 规则13，配置ETag 目前web server的ETag实现不但起不到好的效果，通常还使性能变得更差，真是一个糟糕的设计。 所以静态资源尽量去除ETag配置。但是对于刷新频率不高的Rails动态页面，这个似乎是个不错的大幅 加快响应的方法，值得再深入好好研究一番。 规则14，使Ajax可缓存 就是使用之前的规则应用于Ajax请求，：） 相关博文2010年07月26日 -- 使用Ajax时的十个常犯的错误 (0)2010年05月23日 -- nginx的rewrite规则 (1)2010年07月26日 -- AJAX应用程序开发七宗罪 (0)2010年07月26日 -- AJAX的各种控件和类库 (0)2010年07月26日 -- ajax的缺点 (0)2010年07月26日 -- [...]]]></description>
			<content:encoded><![CDATA[<p><strong>规则1，减少HTTP请求</strong></p>
<p>这是最重要的原则，如果14条规则里只能选一条，那就是它了。可以通过多种方法减少HTTP请求，例如合并图片，合并JS和CSS等等。这一点薄荷网有很多改进的余地，首先应该把现在的JS合并了。</p>
<p><strong>规则2，使用内容发布网络</strong></p>
<p>内容发布网络就是CDN了，但是CDN似乎挺贵的，目前还不适合薄荷网，不过可以考虑自己弄一个网通的静态资源服务器解决有中国特色的可恶的南北互通问题。</p>
<p><strong>规则3，添加Expires头</strong></p>
<p>这个没什么好说的，是个建网站的人都应该知道。目前薄荷网图片,<a href="http://www.5bay.cn/tag/css" class="st_tag internal_tag" rel="tag" title="标签 css 下的日志">css</a>,<a href="http://www.5bay.cn/tag/js" class="st_tag internal_tag" rel="tag" title="标签 js 下的日志">js</a>,flash过期时间设置了3年，可以说是永久了，：） Expires有个麻烦的地方是内容更新问题，Ruby on Rails这方面处理的非常棒，它是在文件名后面自动带了</p>
<p>资源文件的timestamp，完美解决。<span id="more-346"></span></p>
<p><strong>规则4，压缩组件</strong></p>
<p>这个也没什么好说的，配置一下web server的压缩功能，减少服务器带宽，加快响应，立杆见影。</p>
<p><strong>规则5，将样式表放在顶部</strong></p>
<p>这条有点新鲜，虽然平常都是这么做的，但是没有想过不这样做有什么麻烦。如果不这样，浏览器是不能做到边下载边显示，用户体验很糟糕。薄荷网现在有部分样式没放在顶部，回头检查测试一下看看。</p>
<p><strong>规则6，将脚本放在底部</strong></p>
<p>这条是第一次听说，有些震惊。原因在于浏览器下载执行脚本的时候，会阻塞其他资源的下载，这样导致整体响应时间变长。薄荷网的脚本几乎都是放在顶部的，回头测试比较下看看。</p>
<p><strong>规则7，避免CSS表达式</strong></p>
<p>CSS表达是简直像个Bug，可以弃用，寻求变通的解决方便，比如事件处理器等。</p>
<p><strong>规则8，使用外部的JavaScript和CSS</strong></p>
<p>相信大家大部分情形下都是使用外联的，但纯粹的处理而已，内联JS和CSS似乎更快，考虑到缓存和复用，大部分情况显然是外联更划算。因此，在一些情景，例如首页，还是可以使用内联的。</p>
<p><strong>规则9，减少DNS查找</strong></p>
<p>DNS耗费的时间是相当可观的，因此同一页面的域名数量最好控制在2~4之间。</p>
<p><strong>规则10，精简JavaScript</strong></p>
<p>精简JavaScript可以显著减少Js文件的大小，减少下载时间。</p>
<p><strong>规则11，避免重定向</strong></p>
<p>get的重定向可以通过web server的url rewrite很好解决。</p>
<p><strong>规则12，移除重复脚本</strong></p>
<p>重复的脚本既增加一次http请求，又要重复执行，当然坚决移除了。</p>
<p><strong>规则13，配置ETag</strong></p>
<p>目前web server的ETag实现不但起不到好的效果，通常还使性能变得更差，真是一个糟糕的设计。</p>
<p>所以静态资源尽量去除ETag配置。但是对于刷新频率不高的Rails动态页面，这个似乎是个不错的大幅</p>
<p>加快响应的方法，值得再深入好好研究一番。</p>
<p><strong>规则14，使Ajax可缓存</strong></p>
<p>就是使用之前的规则应用于Ajax请求，：）</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/nginxderewriteguize.html" title="nginx的rewrite规则">nginx的rewrite规则</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://www.5bay.cn/tag/css" title="css" rel="tag">css</a>, <a href="http://www.5bay.cn/tag/flash" title="flash" rel="tag">flash</a>, <a href="http://www.5bay.cn/tag/javascript" title="javascript" rel="tag">javascript</a>, <a href="http://www.5bay.cn/tag/js" title="js" rel="tag">js</a>, <a href="http://www.5bay.cn/tag/server" title="server" rel="tag">server</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/%E4%B8%AD%E5%9B%BD%E7%89%B9%E8%89%B2" title="中国特色" rel="tag">中国特色</a>, <a href="http://www.5bay.cn/tag/%E4%BA%BA" title="人" rel="tag">人</a>, <a href="http://www.5bay.cn/tag/%E5%9B%BE%E7%89%87" title="图片" rel="tag">图片</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/tag/%E6%9B%B4%E6%96%B0" title="更新" rel="tag">更新</a>, <a href="http://www.5bay.cn/category/server-building" title="服务器构建&amp;安全" rel="tag">服务器构建&amp;安全</a>, <a href="http://www.5bay.cn/tag/%E6%B5%8F%E8%A7%88%E5%99%A8" title="浏览器" rel="tag">浏览器</a>, <a href="http://www.5bay.cn/tag/%E7%BB%84%E4%BB%B6" title="组件" rel="tag">组件</a>, <a href="http://www.5bay.cn/tag/%E7%BD%91%E7%AB%99" title="网站" rel="tag">网站</a>, <a href="http://www.5bay.cn/tag/%E8%A1%A8" title="表" rel="tag">表</a>, <a href="http://www.5bay.cn/tag/%E8%A7%A3%E5%86%B3" title="解决" rel="tag">解决</a>, <a href="http://www.5bay.cn/tag/%E8%AE%BE%E8%AE%A1" title="设计" rel="tag">设计</a>, <a href="http://www.5bay.cn/tag/%E9%87%8D%E5%AE%9A%E5%90%91" title="重定向" rel="tag">重定向</a>, <a href="http://www.5bay.cn/tag/%E9%A1%B5%E9%9D%A2" title="页面" rel="tag">页面</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URLSEO patchs for PHPOK3.0 simple</title>
		<link>http://www.5bay.cn/me/urlseopatchsforphpok30simple.html</link>
		<comments>http://www.5bay.cn/me/urlseopatchsforphpok30simple.html#comments</comments>
		<pubDate>Mon, 17 Nov 2008 04:00:56 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[邪人邪语]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpok]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[上传]]></category>
		<category><![CDATA[伪静态]]></category>
		<category><![CDATA[成功]]></category>
		<category><![CDATA[版本]]></category>
		<category><![CDATA[程序]]></category>
		<category><![CDATA[自身]]></category>
		<category><![CDATA[说明]]></category>
		<category><![CDATA[链接]]></category>

		<guid isPermaLink="false">?p=308</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/me/urlseopatchsforphpok30simple.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>作者： 江小邪      [主页] 演示： 点击查看 适用版本： 3.0 Simple 添加日期： 2008-11-16 20:01 说明： phpok基于php自身的伪静态补丁。提供形如下面演示地址的形式的链接。有bugs请跟评论，谢谢~ 1、请先删除 data/lock.php 文件 2、上传 压缩包内文件覆盖 phpok目录下的文件 3、运行 http://yoursite/setup.php 进行参数设置。注意务必正确设置phpok安装目录，最后以”/”结束 4、完成后请删除 setup.php 5、程序在phpok 3.0 Simple 下测试成功。 注意：打此补丁前请注意备份，否则所造成后果概不负责。 演示地址：http://phpok3.5bay.cn/html.php/home.html 下载地址：http://mydoc.5bay.cn/phpok3/UrlSeo_patchs_for_phpok3.0S.rar 相关博文2010年07月28日 -- Webshell下破解计算机管理员密码 (0)2010年07月26日 -- 最令PHP初学者头痛的十四个问题 (0)2010年07月26日 -- AJAX应用程序开发七宗罪 (0)2010年07月26日 -- ajax的缺点 (0)2010年07月26日 -- 基于JSON的高级AJAX开发技术 (0)2010年07月28日 -- 帝国备份王(Empirebak)拿webshell (0)2010年07月26日 -- Ajax的工作原理 (1)2010年07月26日 -- 使用Ajax时的十个常犯的错误 (0)2010年07月26日 [...]]]></description>
			<content:encoded><![CDATA[<p>作者： 江小邪      [<a href="http://www.5bay.cn" target="_blank">主页</a>]<br />
演示： <a href="http://phpok3.5bay.cn/" target="_blank">点击查看</a><br />
适用版本： 3.0 Simple<br />
添加日期： 2008-11-16 20:01<br />
说明：</p>
<p>phpok基于php自身的伪静态补丁。提供形如下面演示地址的形式的链接。有bugs请跟评论，谢谢~</p>
<p>1、请先删除 data/lock.<a href="http://www.5bay.cn/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a> 文件<br />
2、<a href="http://www.5bay.cn/tag/%E4%B8%8A%E4%BC%A0" class="st_tag internal_tag" rel="tag" title="标签 上传 下的日志">上传</a> 压缩包内文件覆盖 phpok目录下的文件<br />
3、运行 http://yoursite/setup.php 进行参数设置。注意务必正确设置phpok安装目录，最后以”/”结束<br />
4、完成后请删除 setup.php<br />
5、程序在phpok 3.0 Simple 下测试成功。<br />
注意：打此补丁前请注意备份，否则所造成后果概不负责。</p>
<p>演示地址：<a href="http://phpok3.5bay.cn/html.php/home.html">http://phpok3.5bay.cn/html.php/home.html</a></p>
<p>下载地址：<a href="http://mydoc.5bay.cn/phpok3/UrlSeo_patchs_for_phpok3.0S.rar">http://mydoc.5bay.cn/phpok3/UrlSeo_patchs_for_phpok3.0S.rar</a></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/nginxderewriteguize.html" title="nginx的rewrite规则">nginx的rewrite规则</a> (1)</li><li>2010年08月17日 -- <a href="http://www.5bay.cn/server-building/nginxxiansu.html" title="Nginx限速">Nginx限速</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/ep.html" title="让IIS只监听指定IP">让IIS只监听指定IP</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/2008" title="2008" rel="tag">2008</a>, <a href="http://www.5bay.cn/tag/html" title="html" rel="tag">html</a>, <a href="http://www.5bay.cn/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/phpok" title="phpok" rel="tag">phpok</a>, <a href="http://www.5bay.cn/tag/seo" title="seo" rel="tag">seo</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/%E4%B8%8A%E4%BC%A0" title="上传" rel="tag">上传</a>, <a href="http://www.5bay.cn/tag/%E4%BC%AA%E9%9D%99%E6%80%81" title="伪静态" rel="tag">伪静态</a>, <a href="http://www.5bay.cn/tag/%E6%88%90%E5%8A%9F" title="成功" rel="tag">成功</a>, <a href="http://www.5bay.cn/tag/%E7%89%88%E6%9C%AC" title="版本" rel="tag">版本</a>, <a href="http://www.5bay.cn/tag/%E7%A8%8B%E5%BA%8F" title="程序" rel="tag">程序</a>, <a href="http://www.5bay.cn/tag/%E8%87%AA%E8%BA%AB" title="自身" rel="tag">自身</a>, <a href="http://www.5bay.cn/tag/%E8%AF%B4%E6%98%8E" title="说明" rel="tag">说明</a>, <a href="http://www.5bay.cn/category/me" title="邪人邪语" rel="tag">邪人邪语</a>, <a href="http://www.5bay.cn/tag/%E9%93%BE%E6%8E%A5" title="链接" rel="tag">链接</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/me/urlseopatchsforphpok30simple.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URLSEO patchs for PHPOK 2.2</title>
		<link>http://www.5bay.cn/me/urlseopatchsforphpok22.html</link>
		<comments>http://www.5bay.cn/me/urlseopatchsforphpok22.html#comments</comments>
		<pubDate>Tue, 14 Oct 2008 15:37:40 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[邪人邪语]]></category>
		<category><![CDATA[phpok]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">?p=282</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/me/urlseopatchsforphpok22.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>作者： 江小邪      [主页] 演示： 点击查看 适用版本： 2.2 添加日期： 2008-10-14 07:40 说明： 1、请先删除 data/lock.php 文件 2、上传 压缩包内文件覆盖 phpok目录下的文件 3、运行 http://yoursite/setup.php 进行参数设置。注意务必正确设置phpok安装目录，最后以”/”结束 4、完成后请删除 setup.php 5、程序在phpok 2.2 下测试成功。 注意：打此补丁前请注意备份，否则所造成后果概不负责。 下载地址：http://www.5bay.cn/mydoc/phpok/UrlSeo_for_phpok22.rar 相关博文2008年11月17日 -- URLSEO patchs for PHPOK3.0 simple (0)2010年05月23日 -- 图片轮换类，IE7、OP、FF、Chrome测试通过 (2)2010年07月28日 -- ASP防注入新方式，希望对大家是有用的 (0)2010年07月28日 -- 让IIS只监听指定IP (0)2010年07月26日 -- 最令PHP初学者头痛的十四个问题 (0)2010年07月26日 -- AJAX应用程序开发七宗罪 (0)2010年07月26日 -- Ajax的工作原理 (1)2010年07月26日 -- AJAX初学:IE缓存页面的问题 (0)2010年07月26日 [...]]]></description>
			<content:encoded><![CDATA[<p>作者： 江小邪      [<a href="http://www.5bay.cn" target="_blank">主页</a>]<br />
演示： <a href="http://www.5bay.cn/phpok" target="_blank">点击查看</a><br />
适用版本： 2.2<br />
添加日期： 2008-10-14 07:40<br />
<a href="http://www.5bay.cn/tag/%E8%AF%B4%E6%98%8E" class="st_tag internal_tag" rel="tag" title="标签 说明 下的日志">说明</a>：</p>
<p>1、请先删除 data/lock.<a href="http://www.5bay.cn/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a> 文件<br />
2、<a href="http://www.5bay.cn/tag/%E4%B8%8A%E4%BC%A0" class="st_tag internal_tag" rel="tag" title="标签 上传 下的日志">上传</a> 压缩包内文件覆盖 phpok目录下的文件<br />
3、运行 http://yoursite/setup.php 进行参数设置。注意务必正确设置phpok安装目录，最后以”/”结束<br />
4、完成后请删除 setup.php<br />
5、程序在phpok 2.2 下测试成功。<br />
注意：打此补丁前请注意备份，否则所造成后果概不负责。</p>
<p>下载地址：<a href="http://www.5bay.cn/mydoc/phpok/UrlSeo_for_phpok22.rar">http://www.5bay.cn/mydoc/phpok/UrlSeo_for_phpok22.rar</a></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2008年11月17日 -- <a href="http://www.5bay.cn/me/urlseopatchsforphpok30simple.html" title="URLSEO patchs for PHPOK3.0 simple">URLSEO patchs for PHPOK3.0 simple</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/tupianlunhuanleiie7opffchromeceshitongguo.html" title="图片轮换类，IE7、OP、FF、Chrome测试通过">图片轮换类，IE7、OP、FF、Chrome测试通过</a> (2)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/ep.html" title="让IIS只监听指定IP">让IIS只监听指定IP</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeeeseeao.html" title="ajax基础知识:js事件触发大全">ajax基础知识:js事件触发大全</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/jsshixianquanjingtuxiaoguo360duxuanzhuan.html" title="JS实现全景图效果360度旋转">JS实现全景图效果360度旋转</a> (1)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/phpok" title="phpok" rel="tag">phpok</a>, <a href="http://www.5bay.cn/tag/seo" title="seo" rel="tag">seo</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/category/me" title="邪人邪语" rel="tag">邪人邪语</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/me/urlseopatchsforphpok22.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ASP 获取网页URL代码</title>
		<link>http://www.5bay.cn/network-programming/asp/asp%E8%8E%B7%E5%8F%96%E7%BD%91%E9%A1%B5url%E4%BB%A3%E7%A0%81.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/asp%E8%8E%B7%E5%8F%96%E7%BD%91%E9%A1%B5url%E4%BB%A3%E7%A0%81.html#comments</comments>
		<pubDate>Tue, 18 Jul 2006 01:03:40 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[收藏]]></category>

		<guid isPermaLink="false">?p=74</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/asp%E8%8E%B7%E5%8F%96%E7%BD%91%E9%A1%B5url%E4%BB%A3%E7%A0%81.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>获得当前网页的完整URL &#160; &#160; &#160; &#160; &#160; &#160;获得当前网页的主页地址 &#160; &#160; &#160; &#160; &#160; &#160;获取上一页面来源地址 &#160; &#160; &#160; &#160; request.servervariables(HTTP_REFERER) 相关博文2010年07月28日 -- ASP防注入新方式，希望对大家是有用的 (0)2010年07月26日 -- 了解Ajax中的Get和Post (0)2006年12月8日 -- 精华代码集 (0)2006年10月12日 -- [asp]CodePage And UTF8 (0)2011年06月29日 -- 开源软件的盈利模式 (0)2010年07月28日 -- 如何删除删不掉的”PRN.asp:.jpg” (0)2010年07月28日 -- 让IIS只监听指定IP (0)2010年07月26日 -- 最令PHP初学者头痛的十四个问题 (0)2010年07月26日 -- AJAX应用程序开发七宗罪 (0)2010年07月26日 -- Ajax的工作原理 (1)2010年07月26日 -- AJAX的各种控件和类库 (0)2010年07月26日 -- [...]]]></description>
			<content:encoded><![CDATA[<p>获得当前网页的完整URL &nbsp; &nbsp;<br/> &nbsp; &nbsp; <br/><coolcode><br /><%<br />    aa=”http://”&#038;Request.ServerVariables(“<a href="http://www.5bay.cn/tag/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">server</a>_name”)&#038;Request.ServerVariables(“<a href="http://www.5bay.cn/tag/path" class="st_tag internal_tag" rel="tag" title="标签 path 下的日志">path</a>_info”) <br />%><br /><%=aa%><br /></coolcode><br/><br/> &nbsp; &nbsp;获得当前网页的主页地址 &nbsp; &nbsp;<br/> &nbsp; &nbsp; <br/><coolcode><br /><%<br />   aa=”http://”&#038;Request.ServerVariables(“server_name”)<br />%><br /><%=aa%><br /></coolcode><br/> &nbsp; &nbsp;获取上一页面来源地址 &nbsp; &nbsp;<br/> &nbsp; &nbsp; <br/><coolcode><br />request.servervariables(HTTP_REFERER)<br /></coolcode><br/><br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeetpit.html" title="了解Ajax中的Get和Post ">了解Ajax中的Get和Post </a> (0)</li><li>2006年12月8日 -- <a href="http://www.5bay.cn/network-programming/javascript-ajax/%E7%B2%BE%E5%8D%8E%E4%BB%A3%E7%A0%81%E9%9B%86.html" title="精华代码集">精华代码集</a> (0)</li><li>2006年10月12日 -- <a href="http://www.5bay.cn/network-programming/asp/%5Basp%5Dcodepageandutf8.html" title="[asp]CodePage And UTF8">[asp]CodePage And UTF8</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/ep.html" title="让IIS只监听指定IP">让IIS只监听指定IP</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/url" title="url" rel="tag">url</a>, <a href="http://www.5bay.cn/tag/%E6%94%B6%E8%97%8F" title="收藏" rel="tag">收藏</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/asp%E8%8E%B7%E5%8F%96%E7%BD%91%E9%A1%B5url%E4%BB%A3%E7%A0%81.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

