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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -