<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[【php_ajax】十分钟学会 xajax]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Wed, 27 Dec 2006 04:30:44 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	<p align="center">十分钟学会 xajax<br/><br/><br/>learn xajax in 10 minutes(原文摘自xajaxproject 官方wiki)<br/><br/>译者按: xajax 最大的特点是他采用了xml response，这样我们可以用php来布置，处理异步传送数据之后，网页内容的更新。而这些操作其它的ajax 框架都是由js来完成的的。xajax 使我们只需要写一些php函数，就可以实现。<br/>所有学好xajax的关健在于熟练掌握 xajaxresponse 类。<br/><br/>tutorials:learn xajax in 10 minutes<br/>教程:十分钟学会 xajax<br/><br/>using xajax in a php script<br/>一个使用的xajax的php脚本:<br/><br/>include the xajax class library:<br/>调用xajax类库:<br/><br/>require_once("xajax.inc.php");<br/><br/>instantiate the xajax object:<br/>实例化xajax对象<br/><br/>$xajax = new xajax();<br/><br/>register the names of the php functions you want to be able to call through xajax:<br/>注册一个你想用xajax来调用的php函数名(与javascript中的函数名相对应 xajax_myfunction)<br/><br/>$xajax->registerfunction("myfunction");<br/><br/>write the php functions you have registered and use the xajaxresponse object to return xml commands from them:<br/>编写那个你刚刚已经注册的php函数，并从中用 xajaxresponse 对象来返回xml指令集<br/><br/>function myfunction($arg)<br/>&#123;<br/> &nbsp; &nbsp;// do some stuff based on $arg like query data from a database and<br/> &nbsp; &nbsp;// put it into a variable like $newcontent<br/> &nbsp; &nbsp;//对参数$arg做一些诸如：从数据库中获取数据后定义给$newcontent 变量的基本操作<br/> &nbsp; <br/> &nbsp; &nbsp;// instantiate the xajaxresponse object<br/> &nbsp; &nbsp;//实例化 xajaxresponse 对象<br/> &nbsp; &nbsp;$objresponse = new xajaxresponse();<br/> &nbsp; <br/> &nbsp; &nbsp;// add a command to the response to assign the innerhtml attribute of<br/> &nbsp; &nbsp;// the element with id="someelementid" to whatever the new content is<br/> &nbsp; &nbsp;// 在响应实例中添加一个命令，用来将id为someelementid的innerhtml元素属性<br/> &nbsp; &nbsp;// 变为任何新的内容.<br/> &nbsp; &nbsp;$objresponse->addassign("someelementid","innerhtml", $newcontent);<br/> &nbsp; <br/> &nbsp; &nbsp;//return the xml response generated by the xajaxresponse object<br/> &nbsp; &nbsp;//返回由 xajaxresponse 对象所生成的xml 响应<br/> &nbsp; &nbsp;return $objresponse->getxml();<br/>&#125;<br/><br/>before your script sends any output, have xajax handle any requests:<br/>在你脚本传送出任何东西前,xajax都要处理所有请求<br/><br/>$xajax->processrequests();<br/><br/>between your <head></head> tags, tell xajax to generate the necessary javascript:<br/>在该页的<head>和</head>标签之间插入下列代码，使xajax实例可以自己生成所必需的js<br/><br/><?php $xajax->printjavascript(); ?></p>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] 【php_ajax】十分钟学会 xajax]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>