首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么pjax不能

为什么pjax不能
EN

Stack Overflow用户
提问于 2012-04-28 20:28:38
回答 1查看 1.4K关注 0票数 0

欢迎,

今天我发现并决定把pjax,但我甚至无法从网站复制文件无法工作。

如何让它工作?都填写了here

顺便说一句,有没有可能在点击时更新几个块pjax?

提前感谢!

我的代码:

代码语言:javascript
复制
  <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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-04-29 05:36:09

pjax演示页面依赖于服务器端处理。要使其与静态页面一起工作,您需要使用fragment选项。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10363484

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档