All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
C#中DirectorySearcher组件应用实例
C#中ListBox控件应用实例
javascript的document和window对象详解_JavaScript技术_编程技术
ASP.NET技巧:配置.net,3.0开发环境_.net资料_编程技术
来!把我的Blog数据转移到X-Space里_php资料_编程技术
asp.net计算网站访问量常用代码_[Asp.Net教程]
C#,3.0新特征之创建和初始化集合对象_[Asp.Net教程]
[delphi语法1]Object Pascal语言编写环境
PHP技巧:PHP脚本中关于拼写检查函数库_php资料_编程技术
IIS,6,的,PHP,最佳配置方法_php资料_编程技术
Reading number is top 10 pictures
Startling Russian girl blind date scene1
Sexy women in 2013--2
China's first snake village3
这两天,中国人民到处都可以“看海”了
The real super beauty13
张家界的玻璃桥
胸部遭到偷窥的女人们
赵惟依写真2
No trading, no killing
Chinese paper-cut grilles art appreciation3
Download software ranking
Dance with duck(male prostitution)
Take off clothes to survival
Tram sex maniac 2 (H) rar bag7
matrix3
美女写真2
Tram sex maniac 2 (H) rar bag10
Tram sex maniac 2 (H) rar bag15
Photoshop 8.0图象编辑软件
Boxer's Top ten classic battle9
电脑知识及技巧大合集
归海一刀 published in(发表于) 2014/3/16 2:53:58 Edit(编辑)
十分钟学会 xajax_[AJAX教程]

十分钟学会 xajax_[AJAX教程]

十分钟学会 xajax_[AJAX教程]

译者按: xajax 最大的特点是他采用了xml response,这样我们可以用php来布置,处理异步传送数据之后,网页内容的更新。而这些操作其它的ajax 框架都是由js来完成的的。xajax 使我们只需要写一些php函数,就可以实现。
所有学好xajax的关健在于熟练掌握 xajaxresponse 类。


tutorials:learn xajax in 10 minutes
教程:十分钟学会 xajax


using xajax in a php script
一个使用的xajax的php脚本:


include the xajax class library:
调用xajax类库:


require_once("xajax.inc.php");


instantiate the xajax object:
实例化xajax对象


xajax = new xajax();


register the names of the php functions you want to be able to call through xajax:
注册一个你想用xajax来调用的php函数名(与javascript中的函数名相对应 xajax_myfunction)


xajax->registerfunction("myfunction");


write the php functions you have registered and use the xajaxresponse object to return xml commands from them:
编写那个你刚刚已经注册的php函数,并从中用 xajaxresponse 对象来返回xml指令集


function myfunction(arg)
{
// do some stuff based on arg like query data from a database and
// put it into a variable like newcontent
//对参数arg做一些诸如:从数据库中获取数据后定义给newcontent 变量的基本操作

// instantiate the xajaxresponse object
//实例化 xajaxresponse 对象
objresponse = new xajaxresponse();

// add a command to the response to assign the innerhtml attribute of
// the element with id="someelementid" to whatever the new content is
// 在响应实例中添加一个命令,用来将id为someelementid的innerhtml元素属性
// 变为任何新的内容.
objresponse->addassign("someelementid","innerhtml", newcontent);

//return the xml response generated by the xajaxresponse object
//返回由 xajaxresponse 对象所生成的xml 响应
return objresponse->getxml();
}


before your script sends any output, have xajax handle any requests:
在你脚本传送出任何东西前,xajax都要处理所有请求


xajax->processrequests();


between your tags, tell xajax to generate the necessary javascript:
在该页的和标签之间插入下列代码,使xajax实例可以自己生成所必需的js


printjavascript(); ?>


call the function from a javascript event or function in your application:
从你程序中的js 事件或函数调用之前你已经注册过的相对应函数






添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.