我真的不知道下面的代码有什么问题。我在状态中没有得到任何回应...
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js">
</script>
<input type="text" name="UserName" id="UserName" />
<div id="divStatus"></div>
<script type="text/javascript">
$("#UserName").keyup(function() {
var name = $("#UserName").val();
var status = $("#divStatus");
var user = $.trim(name);
if (user.length > 3) {
status.html("Checking....")
$.getJSON("http://192.168.0.14/openids/api/json/user/username/availability/check/", {
username: name,
}, function(data) {
status.html("got")
});
} else {
status.html("Min 3 letters ");
}
});
</script>
json响应如下:
{"status": "Error", "message": "A user with this username already exists."}