Am creating a page in jquery mobile whereby a jquery function is supposed to check for the set php session variable but i get an error of syntax error in the console.
The code:
$(document).on("pageshow","#schoolperformance", function(){
var sessName = '<?php echo json_encode($_SESSION['schoolname']); ?>';
alert(sessName);
});
When i check the value of $_SESSION['schoolname'] in a normal way via a raw php script it returns a value of the session.
THE FILE IS A JAVASCRIPT FILE that is saved as a .js file