Member Avatar

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 can I do something like that?


//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

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

Be a part of the DaniWeb community

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