jQTouch _webapp 链接
我有一个主页,其他页面上有其他来源。由于服务器限制,我无法使用ajax加载,因此我必须使用target =“_webapp”属性在新页面上加载
<div id="home">
<a href="/the-external.page.html" target="_webapp">Link to external page</a>
... content ...
</div>
由于正常的后退按钮(a href =“#”)不适用于外部页面,所以我正在使用 javascript:history.go(-1)
<div id="the-external-page">
<div class="toolbar">
<h1>The External Page</h1>
<a class="back" href="javascript:history.go(-1)">Back</a>
</div>
<ul>
<li><a href="#page1">Internal page</a></li>
<li><a href="#page2">Internal page</a></li>
</ul>
... content ...
</div>
<div id="page1">
<div class="toolbar">
<h1>Page 1</h1>
<a class="back" href="#">Back</a>
</div>
.. content...
</div>
<div id="page2">
<div class="toolbar">
<h1>Page 2</h1>
<a class="back" href="#">Back</a>
</div>
.. content...
</div>
如果用户导航 #home -> 它就可以工作#the-external-page-> #home
但由于当用户访问 #page1、#page2 时其他页面内有多个链接,因此所有历史记录堆栈和后退按钮只有多次按下后才起作用。
我也无法在后退按钮中放置绝对链接,因为原始页面列表是动态生成的。
有办法回去解决这个问题吗?
I have one main page and other sources on other pages. Since I can't use ajax loading because of the server limitation, I have to use target="_webapp" attribute to load on new page
<div id="home">
<a href="/the-external.page.html" target="_webapp">Link to external page</a>
... content ...
</div>
Since normal back button ( a href="#") doesn't work with external page, I'm using javascript:history.go(-1)
<div id="the-external-page">
<div class="toolbar">
<h1>The External Page</h1>
<a class="back" href="javascript:history.go(-1)">Back</a>
</div>
<ul>
<li><a href="#page1">Internal page</a></li>
<li><a href="#page2">Internal page</a></li>
</ul>
... content ...
</div>
<div id="page1">
<div class="toolbar">
<h1>Page 1</h1>
<a class="back" href="#">Back</a>
</div>
.. content...
</div>
<div id="page2">
<div class="toolbar">
<h1>Page 2</h1>
<a class="back" href="#">Back</a>
</div>
.. content...
</div>
It works if user navigate #home -> #the-external-page -> #home
but since the other pages have multiple link within it when user visit #page1, #page2 all the history stack and the back button doesn't work until pressed multiple time.
I can't put absolute link in the back button either because the list of original pages are dynamically generated.
Is there way to go back to resolve this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有使用您的代码进行测试,但我怀疑 jQtouch 对象中的 .goBack() 可能就是您正在寻找的内容: https://code.google.com/p/jqtouch/wiki/PublicObject
相关部分:
Did not test with your code, but I suspect .goBack() in the jQtouch object may be what you're looking for: https://code.google.com/p/jqtouch/wiki/PublicObject
Relevant section: