jquery - Ajax prasererror on localhost but working fine on live server -
as title says, code works on live server not on localhost.
$.ajax({ type: 'post', url: '/php/get.php', data: {zipcode:zip }, datatype: 'json', success: function(data){ //console.log(data); if(data == ''){ var output="<h1 style='text-align:center;'>no search results</h1>"; document.getelementbyid("itemholder").innerhtml=output; }else{ show(data); } }, error: function(xmlhttprequest, textstatus, errorthrown) { alert("status: " + textstatus); alert("error: " + errorthrown); } });
the error output getting is
status: parsererror error: syntaxerror: unexpected token <
this json parser new me, difference between localhost , live server causing fail?
////edit////
i checked php info , json enabled. database letters , numbers few of these symbols
: - _ .
any more ideas?
Comments
Post a Comment