Archive for the ‘Ajax’ Category

YUI 2.6.0 Released

Friday, October 3rd, 2008

The YUI development community is pleased to announce the release of version 2.6.0 of the YUI Library. You can download YUI 2.6.0 from SourceForge or configure your implementation using the updated YUI Configurator.

Via Yuiblog.com

国际:Dojo Toolkit 1.2 RC1发布!

Saturday, September 27th, 2008

据国外媒体报道,9月22日消息,Dojo团队发布了Dojo Toolkit 1.2 RC1。Dojo是一个非常强大的面向对象的JavaScript的工具箱,它为开发Web胖客户端程序提供了一套完整的Widget和一些特效操作。

新版本改进:

1、在1.1.1版本基础上增加了一千个多个更新、改进和错误修正。

2、大量 Dijit 改进(Dijit是一个基于Dojo的widget库,使用Dijit可以大大简化Web 2.0界面的开发),包括使用.attr()来获得和设置所有的属性,所有的Widgets性能和流畅性都得到极大提升。

3、Dojo Grid做了极大改进,完全支持dojo.data集成

4、绘图功能增强,包括tooltips、animations、events、legends和几个新的绘图类型。

5、doh.robot使用 Selenium 和 Windmill 提供单元测试集成

新功能还包括但不限于下面所列出的:

多文件上传;

优化图片widgets(Lightbox, Slideshow等);

快速的XML解析;

多种数据存储方式;

快速包含Google analytics;

提升windowName和dojox.secure的安全性;

JSON(Path, Query, Referencing, and Schema);

Ajax框架 - ZK3.5新版发布

Thursday, September 11th, 2008

据国外媒体报道,周三ZK3.5版本发布。ZK是Ajax的框架,完全用Java语言编写。具有事件驱动、 170 +组件和标记语言,开发简便,像桌面应用程序开发和HTML /XUL页面一样。ZK支持jsf , JSP, J2EE技术和Java ,Ruby, Groovy的脚本…

突出的新特性
Comet服务器Push可以让开发人员用新的方式创建Web应用程序。
所有ZK组件的布局升级到一个崭新的模式,更加灵活和具有强的交互性。

Grouping Grid和列表框让数据可以直观的显示。
具有更多布局组件- po rtallayout,c o lumnlayout,t a blelayout介绍,以满足不同用户界面设计要求。
一个强大的控件容器-Panel介绍了更多的功能。
Tabbox大大提高了滚动的特性和模式。
概念m oldsclass介绍了自定义的布局z k元件与安心。
Spinner和f isheyebar组件介绍。
图表支持Gannt Chart, w atermap Chart,BubbleChart,WindChart。
具有方便监察Web应用程序性能的机制。
使用URI表达式提高了事件的完成效率。
iFrame支持书签管理。
支持订阅/发布机制。
ZUML支持switch/case 和 choose/when语句
(csdn)

Simplified AJAX For WordPress Plugin Developers using Jquery

Wednesday, September 10th, 2008

I am assuming you know how to write a wordpress plugin, and now you are wondering how to use ajax to add that sexy feature which will make your plugin look bit kool.

I faced the same problem, with my akWpUploder plugin. I googled but could not find anything interesting, or should I say, simple way of adding ajax to my plugin. So I dig into the wordpress code base for solution, as auto-saving feature of wordpress was one such thing that I wanted to use.

There I found what I was really looking for, a very simple way of using Ajax to get things done.

Problem: How to use WordPress functions in you plugin when using ajax

Let me explain the problem first, while I was working on my plugin I needed to insert the photo data into the database. To do this I needed to use wordpress database functions, but the way I knew to use ajax(i.e. creating a separate php file which handles the ajax request), it was bit difficult and messy. It would have involved either making a direct connection with the database or including the wordpress config file.

I was not happy with either of these options, I needed a simpler solution.

(more…)

利用JQuery实现基于Ajax的数据查询、排序和分页功能

Wednesday, September 10th, 2008

之前很少会用JavaScript去实现页功能主要怕麻烦,但了解JQuery后这种想法 发生了变化;有了这样的脚本组件就可以在编写脚本时方便和HTML隔离出来,这样编写高重用性的脚本就更方便。下面就是介绍在学习JQuery过程中编写 的基于Ajax的数据查询、排序和分页功能的复用脚本,只要遵循脚本的某些规则描述HTML把脚本文件引入就可以方便实现以上描述的功能。

先看下实现功能的脚代码:

/**应用脚本规则:

引用脚本: JQuery脚本和JQuery的form插件脚本

Form的ID: viewform

显示数据的div的ID: listview

分页按钮HTML属性: pageindex=”1″

排序按钮HTML属性: orderfield=”employeeid desc”;

提效排序字段Input的ID,Name: orderfield

提交分页索引Input的ID,Name: pageindex

**/

(more…)

用AJAX编写一个简单的相册

Wednesday, September 10th, 2008

AJAX(Asynchronous JavaScript And XML)是一种运用JavaScript和可扩展标记语言(XML),在网络浏览器和服务器之间传送或接受数据的技术。主要应用于Ria(Rich internet applications)的开发上。 2v9源码网

xml问题终于在今天还是解决了。最后在FireFox里还是使用了Dom的一些老方法。我这里就具体解释一下方法吧.2v9源码网

代码:2v9源码网

var XmlHttp; //用来定义一个xmlHttpRequest对象2v9源码网
var temp_url_arr=new Array()2v9源码网
var temp_title_arr=new Array()2v9源码网
var list_arr=new Array()2v9源码网
if (window.XMLHttpRequest) {2v9源码网
XmlHttp = new XMLHttpRequest()2v9源码网
if (XmlHttp.overrideMimeType) {2v9源码网
XmlHttp.overrideMimeType(’text/xml’);2v9源码网
}2v9源码网
} else if (window.ActiveXObject) {2v9源码网
XmlHttp = new ActiveXObject(”Microsoft.XMLHTTP”);2v9源码网
}2v9源码网
// 上面这段话是判断当前浏览器版本,以定义给XmlHttp不同的xmlHttpRequest对象.如果服务器的响应没有XML mime-type header,某些Mozilla浏览器可能无法正常工作。 所以需要XmlHttp.overrideMimeType(’text/xml’);来修改该header.2v9源码网

function getData() { //读取数据2v9源码网
XmlHttp.onreadystatechange = praseXml;2v9源码网
XmlHttp.open(”GET”, “xmldata2.xml”, true);2v9源码网
XmlHttp.send(null);2v9源码网
}2v9源码网

function praseXml() { //解析数据2v9源码网
if (XmlHttp.readyState == 4) {2v9源码网
if (XmlHttp.status == 200) {2v9源码网
var xmldoc = XmlHttp.responseXML;2v9源码网
var root=xmldoc.getElementsByTagName(’data’).item(0)2v9源码网
//使用这样的方法才可在FireFox里面生效.至少xPath我没成功过.2v9源码网
for (var iRoot = 0; iRoot < root.childNodes.length; iRoot ) {2v9源码网
//alert(root.childNodes.item(iRoot))2v9源码网
var pic_node=root.childNodes.item(iRoot)2v9源码网
for (iPic = 0; iPic < pic_node.childNodes.length; iPic ) {2v9源码网
var url_node=pic_node.childNodes.item(iPic)2v9源码网
for (iURL = 0; iURL < url_node.childNodes.length; iURL ) {2v9源码网
var obj=new Object()2v9源码网
obj.type=url_node.nodeName2v9源码网
obj.content=url_node.childNodes.item(iURL).nodeValue2v9源码网
if(url_node.nodeName == “url”){2v9源码网
temp_url_arr.push(obj)2v9源码网
}else if(url_node.nodeName == “title”){2v9源码网
temp_title_arr.push(obj)2v9源码网
}2v9源码网
}2v9源码网
}2v9源码网
}2v9源码网
install_list()2v9源码网
}2v9源码网
}2v9源码网
}2v9源码网

function install_list(){ //整理得到的数据并装载到list_arr数组中。2v9源码网
list_arr=new Array()2v9源码网
var target_div=document.getElementById(’catelog’);2v9源码网
target_div.innerHTML=”"2v9源码网
for(var i=0;i<temp_url_arr.length;i ){2v9源码网
var obj=new Object()2v9源码网
obj.url=temp_url_arr[i].content2v9源码网
obj.title=temp_title_arr[i].content2v9源码网
list_arr.push(obj)2v9源码网
}2v9源码网
for(var i=0;i<list_arr.length;i ){2v9源码网
target_div.innerHTML =”<a href=’#’  onClick=’img_loader(”" list_arr[i].url “”);’>” list_arr[i].title “</a><br>”;2v9源码网
}2v9源码网
}2v9源码网

function img_loader(param1){ //加载图片方法2v9源码网
var target_div=document.getElementById(’pic’);2v9源码网
target_div.innerHTML=”<img src=” param1 “>”2v9源码网
}

当AjaxForm遇上TinyMCE [转]

Thursday, September 4th, 2008

在没有使用AjaxForm前,我做的一个小小的评论提交的Web form,评论内容使用了TinyMCE做文本编辑。为了增加一点点的用户体验,就顺手拿AjaxForm来实现Ajax提交。可是发现出现了一个意外的事情。就是每次提交,第一次提交时,AjaxForm会无法获得当前编辑的评论内容,即TextArea里面的内容,要再点击一次提交,才能将TextArea的内容提交上去。

关键是TinyMCE上的内容没有在提交前更新到TextArea中。于是想看看AjaxForm是否有在提交前的事件绑定,发现在beforeSubmit事件中,formData的内容已经被填充,虽然可以在此处自行将当前的TinyMCE的内容填充上去(详细可查看这里),可是总觉得是不太漂亮的解决方案。

(more…)

jQuery 中 get 和 post 方法传值需要注意的.

Tuesday, September 2nd, 2008

用 jQuery 的都知道,jQuery 的 get 和 post 方法有三个参数:地址,数据 和 回调函数,但我们知道地址也可以跟随数据的(形如:get_data.php?v1=1&v2=2),而且第二个参数可以省略,即第二个参数可以 直接写回调函数,那么数据写在地址后面和写在 data 参数里有什么区别呢?

点击查看原文

Flash and AJAX unite

Wednesday, August 29th, 2007

Here is an article talking about Adobe’s development of Flex-AJAX bridge frameworks.


Adobe Bridges Flash, Flex with AJAX

FABridge

This is a great move by Adobe.

FAVideo Released: Flash Video for JavaScript / AJAX

Tuesday, August 28th, 2007

Grant Skinner and Adobe have teamed up to create an FLV player in Ajax. The intent was to provide a simple interface for AJAX / Web2.0 developers to embed, control, and play video back in their applications.

Full article at gskinner.com