顽皮哥教你做达人脚本
来源:互联网 发布:信托网络个人理财产品 编辑:程序博客网 时间:2024/05/01 01:23
function test(data){
alert(eval(data).name);
}
function XHR(){
this._xhr = null;
}
XHR.prototype.getInstance = function(){
if(window.ActiveXObject)
this._xhr = new ActiveXObject("Microsoft.XMLHttp");
if(window.XMLHttpRequest)
this._xhr = new XMLHttpRequest();
return this;
}
XHR.prototype.ajaxProc = function(url,callback,value){
this._xhr.open("POST",url,true);
this._xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
this._xhr.onreadystatechange = function(){
if(this.readyState==4 & this.status == 200){
eval(this.responseText);
}
}
this._xhr.send("callback=" + callback + "&value=" + value);
this._xhr = null;
}
var obj = new XHR();
alert(eval(data).name);
}
function XHR(){
this._xhr = null;
}
XHR.prototype.getInstance = function(){
if(window.ActiveXObject)
this._xhr = new ActiveXObject("Microsoft.XMLHttp");
if(window.XMLHttpRequest)
this._xhr = new XMLHttpRequest();
return this;
}
XHR.prototype.ajaxProc = function(url,callback,value){
this._xhr.open("POST",url,true);
this._xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
this._xhr.onreadystatechange = function(){
if(this.readyState==4 & this.status == 200){
eval(this.responseText);
}
}
this._xhr.send("callback=" + callback + "&value=" + value);
this._xhr = null;
}
var obj = new XHR();
obj.getInstance().ajaxProc("2.php","test","{\'name\':\'swat\',\'age\':32}");
//天津顽皮哥
$(function(){
$.ajax({
type:"POST",
async:true,
url:"2.php",
data:{"name":"swat","age":32},
success: function(data){
alert(data);
},
error: function(){
alert("fail");
}
});
});
0 0
- 顽皮哥教你做达人脚本
- csdn你又顽皮了
- 动态规划 k好数 顽皮猫为你一边讲解一边写代码
- 教你玩shell脚本
- 顽皮的孩子
- 顽皮的字母
- BOJ【44586】 顽皮的字母
- 手把手教你TestComplete_配置嵌入脚本
- 你需要脚本么?
- 《鳄鱼小顽皮爱洗澡》诞生记
- 然后撅起小嘴顽皮的亲吻着花儿
- pink panther and pals(顽皮豹)
- 教你使用Linux的Shell脚本维护Oracle
- 教你在mac上面创建可执行脚本文件
- 通过分析SQL脚本教你如何创建索引《原创》
- 教你在mac上面创建可执行脚本文件
- 教你如何写框架------用中文构建脚本
- 教你如何写框架------用中文构建脚本
- 串行通信
- 使用对象流实现序列化
- 支持不同设备(3)支持不同版本
- 所谓的沃尔沃惹我热额外额而
- Android静默安装apk
- 顽皮哥教你做达人脚本
- Lua初识之LuaStdio使用方法
- Web控件和HTML控件
- 开发Android调试时logcat不显示输出错误信息的解决办法
- 企业如何做好微信营销
- C++智能指针入门
- html5相较于以前版本不同之处
- Swing JTable例子(如何创建一个JTable)
- MarchingCubes算法提取等值面的基本原理