基于Actionscript3及Javascript构建,轻松解决Javascript跨域问题。
主要功能:
- 使用Flash读取跨域文件。
- Js端使用类似JQuey Ajax语法。
- 一个全局变量,代码侵入性低。
- 可自动将XML转换为Jsonp格式输出。
- 扩展机能:基于Yahoo API的假名标注。
Demo(SVN在线只支持IE浏览器,其余浏览器请自行下载Source观看): http://flajson.googlecode.com/svn/trunk/demo.html
使用例:
flaJson.init();
flaJson.parse({
type : "POST",
dataType : 'jsonp',
data : "id=allovince",
url:'http://ave7.net/feed.xml',
success : function(json){
alert(json);
},
error : function(err){
alert(err);
}
});