您的位置:首页 > 产品设计 > UI/UE

mui ajax 带header 提交

2016-01-09 17:15 666 查看
var server=”http://apis.baidu.com/apistore/stockservice/hkstock?stockid=00168&list=1”;//获取升级描述文件服务器地址

function update(){

mui.ajax(

server,{

dataType:’json’,//服务器返回json格式数据

type:’post’,//HTTP请求类型

timeout:10000,//超时时间设置为10秒;

success:function(data){

alert(JSON.stringify(data));

},

error:function(xhr,type,errorThrown){

//异常处理;

console.log(type);

},

headers: {

“Access-Control-Allow-Headers”:”X-Requested-With”,

“apikey”:”2a4469adb23039b30b55b5970e34f5ac”

}

});

}

mui.plusReady(update);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mui