Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would recommend using <a href="http://php.net/manual/en/function.include.php" rel="nofollow">includes</a> within PHP, if you're application is running on a PHP server. It will simply include the desired script into the page right where you place it, like so:</p> <p><strong>body.php:</strong></p> <pre><code>&lt;p&gt;This is a body page!&lt;/p&gt; </code></pre> <p><strong>index.php:</strong></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en-US"&gt; &lt;head&gt; &lt;meta charset="UTF-8" /&gt; &lt;title&gt;Home&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?php include('body.php'); /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>index.php after processing:</strong></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en-US"&gt; &lt;head&gt; &lt;meta charset="UTF-8" /&gt; &lt;title&gt;Home&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;This is a body page!&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Notice that <code>body.php</code> does not include a <code>&lt;!DOCTYPE&gt;</code>, <code>&lt;html&gt;</code>, or <code>&lt;body&gt;</code> tags. PHP will place the contents of <code>body.php</code> exactly as it sees it. You can include stylesheets and JavaScript within <code>index.php</code> which will style and manipulate the included content as desired.</p> <p>Hope that helps.</p> <p><strong>EDIT:</strong></p> <p>Using jQuery to fetch a page and place it in a container:</p> <pre><code>$.ajax({ 'url' : '/path/to/page.html', 'success' : function(data) { $('div#container').html(data); //Place the fetched content into a &lt;div&gt; with an ID of container } }); </code></pre> <p>Keep in mind that the above code will only work if you are fetching content from the same domain.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload