Member Avatar for arcticM

I want to put my html in a php variable and use this variable in the .html() but it doesn't work as I expect it to..how can I do something like that?

$var="<p>test</p>";

//this works 
$return['script'] = "jQuery('#form_pop_out').html('<p>test</p>');" 

//those don't work
$return['script'] = "jQuery('#form_pop_out').html('$var');" 
$return['script'] = "jQuery('#form_pop_out').html('{$var}');" 
$return['script'] = "jQuery('#form_pop_out').html('".$var."');" 
Member Avatar for arcticM

Oops.. my html text had ' in the middle..
solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.