<script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"></script>
<script type="text/javascript" src="docs/assets/js/jquery.jsonp.js"></script>
<script>
$(document).ready(function(){
var output = $('#output');
$.ajax({
url: 'http://musi.php/?oper=getds&dev_id=f587&cur_id=2',
dataType: 'jsonp',
jsonp: 'jsoncallback',
timeout: 5000,
success: function(data, status){
$.each(data, function(i,item){
var landmark ='<h1>'+item.Nick_Name+'</h1>';
output.append(landmark);
});
},
error: function(){
output.text('There was an error loading the data.');
}
});
});
</script>
我有一个 url(例如)及其 json 值如下:
{"RetVal":"Ok","ValueRsp":[{"Feedback_Id":"22","Customer_Id":"543","Feedback_Type_Id":"1","First_Name":"Tester Tester","Last_Name":"NA","Nick_Name":"Xgcfyxfu"}]}
error: invalid label
Line 1 [Break On This Error]
{"RetVal":"Ok","ValueRsp":[{"Feedback_Id":"22","Customer_Id":"543","Feedback_Typ...
我需要解析它并在我的应用程序中使用它。我是 javascript 新手。好心的帮助