error $.parseJSON
-
Hi everybody ! I am a newer in WordPress. I have a problem when I try to use ajax and Jquery.
Error is:
Uncaught SyntaxError: unexpected token =
x.extend.parseJSON
$.ajax.success
c
p.firewith
k
rThis is code in ajax file
$(‘#Autoload’).change(function(){
var idCate = $(this).val();
var keystring = ‘key=’+idCate;
$.ajax({
type:”POST”,
process:”updatecate.php”,
data:keystring,
success:function(string){
var respData = $.parseJSON(string);
alert(respData.codeID);
}
});
});This is code in file updatecate.php
if(!isset($_POST[‘key’])) exit();
$idCat = $_POST[‘key’];
$arr = array(
‘codeID’ => $idCat,
);echo json_encode($arr);
die;I don’t know what does this error. and how to fix it. Please help me. Thanks so much !
The topic ‘error $.parseJSON’ is closed to new replies.