So, a quick breakdown.
I've got a function on my page loads three sections, currently it loads them separately (which is kind of slow). So I've recently combined them all. I now have all of the information stored in PHP variables. I'd like to get those PHP variables and load them into separate divs.
here is an example of what I'd like to do.
HTML
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
PHP
$var1 = "<div><p>data 1</p></div>";
$var2 = "<div><p>data 2</p></div>";
$var3 = "<div><p>data 3</p></div>";
jQuery
//`get var1,var2,var3`
// load var1 into div.one
// load var2 into div.two
// load var3 into div.three
The current problem I'm having is json_encode is changing some information into this "\n\t\t\t\t\t\t" and it's printing
"<div><p>data 1</p></div>"
instead of "data 1" in a p inside of a div.
scriptyou can do this:var phpDiv = "<?php echo $var1; ?>";jQuery.text()instead ofjQuery.html()