Let's say I have a "test.html" file with some example content:
<table>
<tr>
<td>'Test'</td>
<td>Test "2"</td>
</tr>
</table>
And I want to use that as a jQuery object. My first instinct would be to attempt:
var $testobject = $("<?php include('./test.html');?>");
But with the line breaks and quotes in test.html, this would fail. I specifically need the test.html file to be a jQuery object so it is hidden on load and is put in different places on the page with various triggered scripts, and I would prefer to use the more static PHP approach than a jQuery load. There must be a simple trick to manage this...
file_get_contentsinsteadinclude.