netero
netero

Reputation: 3

Why does not pjax

Welcome,

Today I found and decided to put pjax, but I could not even copy files from the site did not work.

How to make it work? All filled in here.

And by the way is it possible to update a few blocks pjax when clicked?

Thanks in advance!

my code:

  <script src="http://pjax.heroku.com/jquery.js"></script>
  <script src="http://pjax.heroku.com/jquery.cookie.js"></script>
  <script src="http://pjax.heroku.com/pages.js"></script>

  <script src="http://pjax.heroku.com/jquery.pjax.js"></script>
  <script type="text/javascript">
    $(function(){
      // pjax
      $('ul a').pjax('#main')
    })
  </script>
<pre>

           / ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
           | <b>It's 09:32:10 PM</b>
           \_  ________________
    .--.     (  )
   /    \   ( )
  ## a  a  .
  (   '._)
   |'-- |
 _.\___/_   ___<label><input type="checkbox" name="pjax" />pjax</label>___
   ."\> \Y/|<'.  '._.-'
  /  \ \_\/ /  '-' /
  | --'\_/|/ |   _/
  |___.-' |  |`'`
    |     |  |
    |    / './
   /__./` | |
      \   | |
       \  | |
       ;  | |
       /  | |
 jgs  |___\_.\_
      `-"--'---'

<a href="https://github.com/defunkt/jquery-pjax">github.com/defunkt/jquery-pjax</a>
</pre>

<div id="main">
  <ul>
  <li>home</li>
  <li><a href="/dinosaurs.html">dinosaurs</a></li>
  <li><a href="/aliens.html">aliens</a></li>
</ul>

<p>
  pjax loads html from your server into the current page
  without a full page load. It's ajax with real permalinks,
  page titles, and a working back button that fully degrades.
</p>

<p>
  Check the box to toggle pjax.
</p>

<p>
  Whenever the time changes, a full page load has happened.
  If the time doesn't change,  no full page load has occurred.
</p>

<p>
  The idea is you can't tell the difference between pjax
  page loads and normal page loads. On complicated sites,
  browsing just "feels faster."
</p>

<p>
  <a href="https://github.com/defunkt/jquery-pjax/tree/heroku">
    view this example's source code
  </a>
</p>

</div>

Upvotes: 0

Views: 1421

Answers (1)

Sean Hogan
Sean Hogan

Reputation: 2920

The pjax demo pages rely on server side processing. To get it working with static pages you need to use the fragment option.

Upvotes: 1

Related Questions