Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Edit: <strong>The main problem is that you are trying to use a cutting-edge browser feature without having mastered basic debugging of a web-page.</strong></p> <p>You resolved the error with <code>getallheaders()</code> in php, so this should be easy for you. </p> <p>Step 1: Load <a href="http://www.bluereservations.com/pjax.php" rel="nofollow">http://www.bluereservations.com/pjax.php</a>, open the browser console, refresh the page and check for messages in the console.</p> <p>It reports an error that <code>$ is not defined</code>. That suggests <code>jquery</code> didn't load successfully. </p> <p>Step 2: Load <a href="http://www.bluereservations.com/jquery.js" rel="nofollow">http://www.bluereservations.com/jquery.js</a></p> <p>One mystery solved.</p> <p>AFTER getting all the obvious problems with the page out of the way, then look at more obscure things. For pjax that will involve inspection of network resources, http request and response headers, etc. </p> <p>If you are using Firebug for Firefox then read <a href="http://getfirebug.com/wiki/index.php/Net_Panel" rel="nofollow">http://getfirebug.com/wiki/index.php/Net_Panel</a> for details. For pjax you will need to turn on the <code>persist</code> option in case pjax fails. </p> <p><strong>The following might address the other issues with your test-pages...</strong></p> <p>When responding to a <code>X-PJAX</code> request you only send the main content, not the whole page. For your test-case something like </p> <pre><code>&lt;?php $headers = getallheaders(); if($headers['X-PJAX'] == 'true'): ?&gt; first change &lt;?php else: ?&gt; &lt;html&gt; &lt;head&gt; &lt;script src="jquery.js"&gt;&lt;/script&gt; &lt;script src="jquery.cookie.js"&gt;&lt;/script&gt; &lt;script src="jquery.pjax.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { $('a[data-pjax]').pjax(); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;?php $header = "this is first part &lt;br/&gt; &lt;a href='pjax2.php' data-pjax='main'&gt;GO&lt;/a&gt;"; $date = date("Y-m-d H:i:s"); $footer = "this is second part"; echo "$header&lt;br/&gt;$date&lt;br /&gt;&lt;div id='main'&gt;first page&lt;/div&gt;&lt;br /&gt;$footer"; ?&gt; &lt;/body&gt; &lt;/html&gt; &lt;?php endif; ?&gt; </code></pre> <p>jquery-pjax does allow you to send the whole file in response to <code>X-PJAX</code> requests. Look in the docs for the <code>fragment</code> option. </p> <p>Personally <a href="http://github.com/shogun70/HTMLDecor" rel="nofollow">HTMLDecor</a> is a much easier way to get free <code>pushState</code> support, but I'm biased.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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