0
我的應用程序中有一個初始init頁面,它充當入口點並加載我的登錄頁面。Jquery Mobile - 頁面加載時禁用對話框?
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile- 1.3.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
</head>
<body>
<!-- initialse and load the application -->
<div data-role="page" id="init">
<script type="text/javascript">
$('#init').live('pageinit', function() {
window.location.href="views/login.html";
});
</script>
</div>
</body>
</html>
當我的登錄頁面加載時,有一個按鈕用於加載對話框。此按鈕最初不起作用,只在手動刷新頁面時加載對話框。爲什麼會發生這種情況,我能做些什麼來在頁面加載時立即啓用按鈕/對話框。
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
</head>
<body>
<!-- login page -->
<div data-role="page" id="login">
<!-- css -->
<link rel="stylesheet" href="../css/global.css" />
<link rel="stylesheet" href="../css/login.css" />
<!-- page markup -->
<div data-role="header">
<a href="#settings_dialog" data-rel="dialog" data-role="button" data-mini="true" data-inline="true" data-icon="gear" data-theme="b">Settings</a>
</div>
</div>
<!-- end of page -->
<!-- settings dialog page -->
<div data-role="dialog" id="settings_dialog">
<!-- page markup -->
<div data-role="header" style="text-align: left;">
<a href="" data-rel="back" data-role="button" data-icon="delete" data-iconpos="notext" data-iconpos="left" data-inline="true"></a>
</div>
<div data-role="content">
</div>
</div>
<!-- end of page -->
</body>
</html>