How to grab a declared PHP variable as jQuery selector? -
i cannot figure out how grab php variable , use jquery variable.
so, i've got example variable:
$content = "bla bla bla";
and inside div:
div id='contentwrapper'
$content = "bla bla bla";
/div
i know how grab id, class , content (text) of div contentwrapper, how grab $content? hope being clear enough :)
in javascript, can do:
edit:
based on @marc b's comment.
var jsvar = <?php echo json_encode($content); ?>
Comments
Post a Comment