原生js版ajax请求
发布时间:2015-12-04 12:01:20
function get var xhr; if(window.ActiveXObject) { ...
- function get
- var xhr;
- if(window.ActiveXObject) {
- xhr= new ActiveXObject("Microsoft.
- }else if (window.
- xhr= new
- }else {
- xhr= null;
- }
- return xhr;
- }
-
- function save() {
- var xhr = get
- xhr.open("post","url");
- var data = "name=mikan&address=street...";
- xhr.send(data);
- xhr.onreadystatechange= function() {
- if(xhr.readyState == 4 && xhr.status == 200) {
- alert("returned:"+ xhr.responseText);
- }
- };
- }
原标题:原生js版ajax请求
关键词:JS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。