似乎jQuery手機在啓動頁面附加了加載消息。我真的不知道發生了什麼事情,但考慮下面這個簡單的代碼片段:jQuery手機將「加載標題」附加到頁面
<!DOCTYPE html>
<html>
<head>
<title>sadFace</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta charset="utf-8" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head>
<body>
<h1>;__;</h1>
</body>
</html>
我甚至不得不向下滾動以查看加載消息。所以我認爲這可能會發生,因爲我沒有遵循典型的jQuery手機網頁解剖結構,但是:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>;_;</h1>
</div><!-- /header -->
<div data-role="content">
<p>Same shit, different page.</p>
</div><!-- /content -->
<div data-role="footer">
<h4><a href="http://www.google.com/pacman/">need cookies :C</a></h4>
</div><!-- /footer -->
</div><!-- /page -->
</body>
</html>
相同。我完全被這種行爲震驚。即使從上週開始我的項目,我也測試jQuery1.0rc2具有相同的結果,它看起來很好。這是怎麼回事<。 <
仰望jQuery Mobile' js我認爲這initializePage: function()
是負責的消息。我可以註釋掉
//cue page loading message
$.mobile.showPageLoadingMsg();
或設置autoInitializePage: false
但我寧可選擇這不涉及修改的jQuery文件的解決方案(除非它是一個bug)。
除了CSS和所有這些框架都做同樣令人討厭的事情 - 並試圖覆蓋基本元素的佈局首選項,如 ... –
這是一個很好的解決方案。但爲什麼它需要追加它? – Carmela
我該如何阻止它放置h1? – Jayen