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);


本文转载:CSDN博客