Xajax中文手册(第一版)
出处:
本站整理 作者:佚名 日期:2007-5-7 12:12:09 人气: [
大
中 小]
. 它可以处理复杂的
input 元素名称 ,例如 "checkbox[][]" 或者 "name[first]" 产生的多维或者关联数组(哈希数组), 就是普通提交表单那样使用PHP的$_GET数组
- xajax provides easy asynchronous Form processing. By using the xajax.getFormValues() javascript method, you can easily submit an array representing the values in a form as a parameter to a xajax asynchronous function:
xajax_processForm(xajax.getFormValues('formId');
. It even works with complex input names like "checkbox[][]" and "name[first]" to produce multidimensional and associative arrays, just as if you had submitted the form and used the PHP $_GET array
- 使用xajax你可以动态的发送附加的javascript作为请求的响应到你的应用软件中运行,而这就和动态的更新元素的属性一样方便.
- Using xajax you can dynamically send additional javascript to your application to be run in response to a request as well as dynamically update element attributes.
- Xajax会自动比较PHP函数返回的数据与你已经标记需要修改的元素属性. 只有当新的数据确实可以改变现有的属性,属性才会真的被更新. 这将可消除程序在一定时间间隔内更新与当前内容相同或者不同的内容而出现的明显的闪烁.
- xajax automatically compares the data returned from the PHP functions to the data that is already in the attribute of the element you have marked for change. The attribute is only updated with the new data if it will actually change what is already in the attribute. This eliminates the flicker often observed in applications that update content at a regular time interval with data which may or may not differ from extant content.
- 每一个通过xajax简单注册的函数都可以有不同的请求方式. 所有的函数默认使用POST方式,除非你明确的指定使用GET方式. 如果使用GET请求,你必须非常明确的考虑它确实是你所需要的
- Each function registered to be accessible through xajax can have a different request type. All functions default to use POST unless GET is explicitly set. This is to encourage careful consideration of when to use GET requests
- 如果没有指定URI,xajax将设法自动确定脚本的URI. Xajax的自动确定算法经过了充分的验证,确保在大部分HTTPS或者未知端口的HTTP服务器上也可以正常的工作.
- If no request URI is specified, xajax tries to autodetect the URL of the script. The xajax autodetection algorithm is sophisticated enough that, on most servers, it will work under a secure https:// protocol as well as http:// and with nonstandard ports.
- Xajax使用UTF8编码所有的请求和响应,以确保支持绝大部分的字符和语言. Xajax已经成功测试了多种不同的UNICODE字符,包括Spanish, Russian, Arabic, and Hebrew
- xajax encodes all of its requests and responses in UTF-8 so that it can support a wider range of characters and languages. xajax has been successfully tested with various unicode characters including Spanish, Russian, Arabic, and Hebrew
- 几乎所有xajax生成的javascript都可以通过动态的外部javascript包含到你的web程序之中. 当你在浏览器之中查看程序的源代码时,不会有JavaScript的函数定义混杂在HTML标记之中.
- Nearly all of the javascript generated by xajax is included into your web application through dynamic external javascript. When you view the source of your application in your browser, the markup will be not cluttered by JavaScript function definitions.
- Xajax可以使用在Smarty模板系统之中,仅仅需要创建一个smarty变量就可以包含xajax的javascript:
$smarty->assign('xajax_javascript', $xajax->getJavascript());
然后你可以使用在header模版之中使用
{$xajax_javascript}
从而把xajax应用到你的站点.
- xajax can be used with the Smarty templating system by creating a variable in smarty that contains the xajax javascript:
$smarty->assign('xajax_javascript', $xajax->getJavascript());
Then you can use
{$xajax_javascript}
in your header template to use xajax on your site.