Can some one tell why this simple JSON with JqUERY doesn't work for me?
I have this JS code,
var jsonParam = <? $json = $_SESSION['searchSess']; echo json_encode($json);?>;
jsonParam = JSON.stringify(jsonParam);
$(document).ready(function(){
$.post("searching.php?rdr=search", {data: jsonParam,}, function (data){
alert(data)
})
});
And Here is the PHP code,
$data = json_decode($_POST['jsonParam'], true);
var_dump($data);
And the response is null or nothing,
can please someone help whats wrong here?
Thank you