为什么jQuery Mobile链接不工作没有data-ajax =“false”? [英] jQuery Mobile links not working without data-ajax="false", why?

查看:143
本文介绍了为什么jQuery Mobile链接不工作没有data-ajax =“false”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个支持jQuery Mobile的网站。在这个网站上我有一些收件箱页面,你可以按下一个按钮,将你重定向到你点击的消息。但是我不能让超链接在没有 data-ajax =false的情况下工作,这意味着我无法使用jQuery Mobile提供的任何漂亮的动画。 : - (



如果我不使用 data-ajax =false属性,页面会加载一个白页,所以我想知道为什么有必要使用data-ajax属性?以及如何更改链接以使其在没有data-ajax属性的情况下工作,因此我可以再次使用动画。 p>

这是我的链接:

 < a href =/ members / stuurbericht / 513661?prid = 3575data-ajax =false> 
< img src =btn_stuurbericht.pngclass =fifthimage>
< / a>

=============编辑========= ======



猜猜这个问题在stackoverflow的历史中丢失了,所以我希望编辑它会加快它或什么...



如果没有 data-ajax =false,我仍然无法使用任何链接,并且每个页面都有问题当我点击一个链接时:

 < a href =/ zoeken?prid = 3575data-transition = 滑动 >< / A> 

JQM在该页面位于 body 标记内。 div 的html是:

 < div data-role =pagedata-url =/ zoeken?prid = 3575data-external-page =true
tabindex =0class =ui-page ui-body-c ui-page-active style =min-height:494px;>
< / div>

我期望这个div应该包含页面的HTML代码,但它不会,正如你所看到的内容是空的(就像显示的页面一样)。也没有jQuery的错误,不幸的是我的jQuery知道很少看到加载页面的HTML($ .mobile.changePage)的jquery移动功能内出现了什么问题。



抱歉,我无法添加任何实际网站的源代码,因为我喜欢匿名了解我的工作。但我可以保证页面上没有错误(jquery / html),页面包含一个漂亮的< html>< head>< / head>< body>< div data -role =page>< / div>< / body>< / html>< / code>结构。

解决方案



愚蠢的我...


I'm currently working on a jQuery Mobile enabled website. On this website I have some kind of inbox page, where you can press a button that will redirect you to the message you clicked. But I cannot get the hyperlink to work without data-ajax="false", which means, I cannot use any of the nice animations jQuery Mobile offer. :-(

If I don't use the data-ajax="false" attribute the page loads a white page, so I would like to know why it is necessary to use the data-ajax attribute? And how I can change the link so that it will work without the data-ajax attribute, so I can use the animations again.

this is my link:

<a href="/members/stuurbericht/513661?prid=3575" data-ajax="false">
    <img src="btn_stuurbericht.png" class="fifthimage">
</a>

============= EDIT ===============

Guess this question got lost in the history of stackoverflow, so I hope editting it will upvote it or something...

I still cannot use any links without the data-ajax="false", and it turns out to be a problem with every page on my website. When I click a link:

<a href="/zoeken?prid=3575" data-transition="slide"></a>

JQM adds a div at the bottem of the page, within the body tag. The html of this div is:

<div data-role="page" data-url="/zoeken?prid=3575" data-external-page="true" 
tabindex="0" class="ui-page ui-body-c ui-page-active" style="min-height: 494px;">
</div>

I would expect that this div should contain the HTML code of the page, but it doesn't, as you can see the content is empty (like the page that is showing). Also there are no jquery errors, and unfortunently my jquery knownledge is too little to see what goes wrong inside the jquery mobile function that loads the HTML of the page ($.mobile.changePage).

I'm sorry but I cannot add any source code of the actual website because I like to remain anonymous about my work. But I can assure there are no errors on the page (jquery / html) and the page consist of a nice <html><head></head><body><div data-role="page"></div></body></html> structure.

解决方案

I forgot the website was dealing differently with AJAX calls, that was the reason...

Stupid me...

这篇关于为什么jQuery Mobile链接不工作没有data-ajax =“false”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆