lyj11021102
lyj11021102
  • 发布:2015-03-24 23:50
  • 更新:2015-03-25 13:39
  • 阅读:6038

mui ajax 服务器没有响应,这是什么情况?

分类:MUI

<!DOCTYPE html>
<html>
<head>
<script src="js/mui.min.js"></script>
<script src="js/app.js"></script>
<link href="css/mui.min.css" rel="stylesheet"/>
<script type="text/javascript" charset="utf-8">
function subumitfrom()
{
var username = document.getElementById("username").value;
var aa = document.getElementById("password").value;
mui.ajax('http://192.168.65.1:8080/login.html',{
data:{
username:'username',
password:'password'
},
dataType:'json',//服务器返回json格式数据
type:'post',//HTTP请求类型
timeout:10000,//超时时间设置为10秒;
success:function(data){
//服务器返回响应,根据响应结果,分析是否登录成功;
},
error:function(xhr,type,errorThrown){
//异常处理;
console.log(JSON.stringify(xhr));
}
});
}
</script>
</head>

<div class="mui-input-row">  
            <label>用户名:</label>  
            <input type="text" id="username" name="username" placeholder="输入用户名">       
</div>  
<div class="mui-input-row">  
            <label>密码:</label>  
            <input type="text" id="password" name="password" placeholder="输入密码">  
</div>  

<button id="submitFrom" onclick="subumitfrom();">登录</button>
</body>
</html>

后台打印
[LOG] : {"readyState":0,"responseText":"","responseXML":null,"status":0,"statusText":null,"responseType":null,"response":null,"noParseResponseHeader":null,"requestHeaders":{},"responseHeaders":{},"cacheReponseHeaders":{},"UUID":"xhr31427211058034"}

请问大侠这是什么情况啊?

2015-03-24 23:50 负责人:无 分享
已邀请:
DCloud_UNI_FXY

DCloud_UNI_FXY

后台打印什么错误?

lyj11021102

lyj11021102 (作者)

这是日志信息,大侠帮忙看一下

DCloud_UNI_FXY

DCloud_UNI_FXY

用postman模拟一下你的post请求,看看有没有问题

  • mario6

    模拟了 可以请求 进服务端的断点,但是 用MUI.ajax 发请求就没反应。。。 显示415 错误 或者不支持的 media type

    2016-04-12 09:55

  • DCloud_UNI_FXY

    回复 mario6:排查服务器接受的类型,自己在ajax里设置成一致的。

    2016-04-12 16:59

  • 海带

    回复 DCloud_UNI_FXY:手机上服务没响应 ,但是模拟器上可以调用 是什么原因

    2017-09-08 12:46

该问题目前已经被锁定, 无法添加新回复