mui.plusReady(function() {
mui.ajax('http://www.jrcs.com/api/v1/index',{
headers: {
sign:'ff',
app_type:'ios'
},
dataType:'json',//服务器返回json格式数据
type:'GET',//HTTP请求类型
timeout:10000,//超时时间设置为10秒;
headers:{'Content-Type':'application/json'},
success:function(data){
//console.log(data.stories[0].images);
//获取数据
//console.log(data.data.heads[0].id);
console(data);
//var html=template('list',data);
//console.log(html)
//document.getElementById("news").innerHTML=html;
},
error:function(xhr,type,errorThrown){
//异常处理;
console.log(type);
console.log(errorThrown);
}
});
})
。报错如下:
28 KB/s (4054 bytes in 0.137s)
文件/tpl/index.html同步完成...
error at tpl/index.html:108
Forbidden at tpl/index.html:109
,就是到异常了