脱离jQtouch?

发布于 2024-08-31 16:35:25 字数 128 浏览 2 评论 0原文

我试图让我的移动用户可以选择通过加载不同的页面来查看完整的网站。

事实是,jQtouch 深思熟虑地将链接转换为 ajax 调用,因此用户根本不会离开页面。

有没有办法打破jQt或排除某些链接加载ajax方式?

I'm trying to give my mobile users the choice to view the full website by loading a different page.

Thing is, jQtouch thoughtfully transforms links into ajax calls, so the user doesn't leave the page at all.

Is there some way to break out of jQt or exclude certain links from loading ajaxically?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

汐鸠 2024-09-07 16:35:25

我也有同样的问题。

检查源代码表明您可以显式添加一个属性来阻止库尝试“ajaxify”链接:

支持在新窗口中打开链接target="_blank"

rel="同一窗口支持“external”

I had the same question.

Inspecting the source code reveals that you can explicitly add an attribute to stop the library trying to "ajaxify" a link:

target="_blank" is supported for opening links in new windows

rel="external" is supported for the same window.

独﹏钓一江月 2024-09-07 16:35:25

只需将 target="_blank" 添加到您的外部链接即可。

http://code.google.com/p/jqtouch/issues/详情?id=9

Just add target="_blank" to your external links and it should work.

http://code.google.com/p/jqtouch/issues/detail?id=9

渡你暖光 2024-09-07 16:35:25

如果您希望 jQTouch 忽略外部链接,那么只需为同一窗口链接添加 rel="external" 或为新窗口链接添加 target="_blank" 即可。然而,一个常见的问题是 jQTouch 拦截所有 AJAX 命令(表单、POST 命令等)并自行安全地提交它们。这不是问题,除非它期待某种回调,但实际上并没有回调。在最近的一个项目中,我想提交一个没有回调的表单。为此,请查看 jqtouch.js 库(第 434 行左右)并注释掉以下行:

if (href != '#') {
   $.ajax({
      url: href,
      data: settings.data,
      type: settings.method,
      success: function (data) {
          **// var firstPage = insertPages(data, settings.animation);**

这基本上只是告诉 jQTouch 提交 AJAX 调用,但之后不执行任何操作。它不会更改 div,不会显示任何回调,也不会调用任何动画。希望这对某人有帮助。

If you want jQTouch to ignore the external link, then yes just add rel="external" for same-window links or target="_blank" for new-window links. However, a common problem is that jQTouch intercepts all AJAX commands (forms, POST commands, etc) and safely submits them itself. This isn't a problem except for when it's expecting some sort of callback, and there isn't one. In a recent project, I wanted to submit a form without a callback. To do this, look in the jqtouch.js library (around line 434) and comment out the following line:

if (href != '#') {
   $.ajax({
      url: href,
      data: settings.data,
      type: settings.method,
      success: function (data) {
          **// var firstPage = insertPages(data, settings.animation);**

This basically just tells jQTouch to submit the AJAX call but do nothing afterwards. It won't change div's, it won't show any callbacks and it won't call any animations. Hope this helps someone.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文