<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>
i have a url(for eg) and its json values as follows:
{"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...
i need to parse it and use it in my app. i am new to javascript. kindly help
http://musi.php/a Phonegap thing? It looks strange for a URL. If that's the case, see how you set up JSONP wit Phonegap.