【发布时间】:2013-06-12 21:01:48
【问题描述】:
我使用来自django-easy-pjax。 我有这个基本代码:
ubase.html
<script type="text/javascript" src="{% static "/static/js/jquery-1.9.1.min.js" %}"></script>
<script src="{% static "/static/js/jquery.pjax.js" %}"></script>
{% block side%}
It is {% now "c" %}
sdfdsfdsf
<a href="/uu/">uu</a>
<a href="/uu1/">uu1</a>
<br/><br/><br/><br/><br/><br/>
{%endblock side%}
{%block main%}
sdfdfsdfdsfdsfdfdsf
{%endblock main%}
entry_index.html
{% extends "ubase.html"|pjax:request %}
{%block main%}
1
{%endblock main%}
entry_index2.html
{% extends "ubase.html"|pjax:request %}
{%block main%}
2
{%endblock main%}
我的观点:
def entry_index1( request ):
return render_to_response('entry_index1.html', {}, context_instance = RequestContext(request))
def entry_index( request ):
return render_to_response('entry_index.html', {}, context_instance = RequestContext(request))
还有我的网址
url(r'^uu/$', search_views.entry_index),
url(r'^uu1/$', search_views.entry_index1),
但是当我使用点击 uu 链接或 uu1 链接时,时间会发生变化,pjax 不能像这样example. 为什么会这样?
【问题讨论】:
-
您能否在此处编辑您为使其正常工作所做的更改并添加
pjax_ubase.html的代码或您对代码所做的任何其他更改以使其正常工作!
标签: python django single-page-application pjax