doupai6875
2014-06-14 17:33
浏览 47
已采纳

JQuery移动样式持续到页面我链接到

I am using a link from a page where I use Jquery Mobile to a page where I do not. For some reason the Jquery Mobile styling persist onto the page that I link to UNTIL I refresh the page, in which case the page loads correctly. I am pretty baffled at what might cause this issue, and I have tested it on both Firefox and Chrome. I have tried disabling caching all with no luck.

Does anyone have an idea what could cause this?

Thanks in advance.

hello_world.php:

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
</head>
<body>
<a href="create2.php" data-icon="plus" class="ui-btn-left">Create</a>

</body>
</html>

create2.php:

<!DOCTYPE HTML> 
<html>
<head>
</head>
<body> 
<form>
Title: <input type="text" name="title" value="">
submit: <input type="submit" value="submit">
</form>
</body>
</html>

图片转代码服务由CSDN问答提供 功能建议

我正在使用从我使用 Jquery Mobile 的页面到页面的链接 我不。 出于某种原因, Jquery Mobile 样式持久存在我链接到 UNTIL 的页面上。我刷新页面,在这种情况下页面正确加载。 我对可能导致此问题的原因感到困惑,我已经在Firefox和Chrome上测试了它。 我已经尝试过禁用缓存而没有运气。

有没有人知道可能导致这种情况的原因?

提前致谢。

hello_world.php:

 &lt; html&gt; 
&lt; head&gt; 
&lt; meta name =“viewport”  content =“width = device-width,initial-scale = 1”&gt; 
&lt; link rel =“stylesheet”href =“css / styles.css”&gt; 
&lt; link rel =“stylesheet”href =“http  ://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css“&gt; 
&lt; script src =”http://code.jquery.com/jquery-1.10。  2.min.js“&gt;&lt; / script&gt; 
&lt; script src =”http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js“&gt;  &lt; / script&gt; 
&lt; / head&gt; 
&lt; body&gt; 
&lt; a href =“create2.php”data-icon =“plus”class =“ui-btn-left”&gt;创建&lt; / a&gt;  
 
&LT; / BODY&GT; 
&LT; / HTML&GT; 
   
 
 

<强> create2.php:

 &lt;!DOCTYPE HTML&gt;  
&LT; HTML&GT; 
&LT; HEAD&GT; 
&LT; /头&GT; 
&LT;身体GT;  
&lt; form&gt; 
标题:&lt; input type =“text”name =“title”value =“”&gt; 
submit:&lt; input type =“submit”value =“submit”&gt; 
&lt; / form&gt  ; 
&lt; / body&gt; 
&lt; / html&gt; 
   
 
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanchuaiwan0063 2014-06-14 17:47
    已采纳

    refer this page to understand how jquerymobile's link works

    put this attributes to anchor rel="external", data-ajax="false"

    http://demos.jquerymobile.com/1.2.0/docs/pages/page-links.html

    Links that point to other domains or that have rel="external", data-ajax="false" or target attributes will not be loaded with Ajax

    Default link behavior: Ajax

    To enable animated page transitions, all links that point to an external page (ex. products.html) will be loaded via Ajax. To do this unobtrusively, the framework parses the link's href to formulate an Ajax request (Hijax) and displays the loading spinner. All this is done automatically by jQuery Mobile.

    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题