我已经使用 html5 和 jQuery,jQuery-mobile 实现了登录屏幕。
应用程序.html
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Application</title>
<link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.1.1.css" />
<!-- <link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.1.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.theme-1.1.1.css" /> -->
<link rel="stylesheet" type="text/css" href="css/login.css" />
<script type="text/javascript" src='js/jquery-1.8.2.js'></script>
<script type="text/javascript" src="js/jquery.mobile-1.1.1.js"></script>
<script type="text/javascript" src="js/login.js"></script>
</head>
<body>
<div data-role="page" id="pagecontent" class="type-interior">
</div>
</body>
</html>
登录.js
var _header = "<div data-role='header' data-theme='b' ><h1 id='pheader'>Mobile Sign On </h1> <a data-role='button' id='logoutbtn' data-theme='b' class='hide'>Logout</a></div>";
var _content ="<div data-role='content'>" +
"<div align='center' id='logindiv'>"+
"<div data-role='fieldcontain'><label for='userid' id='luserid'>User Name *:</label>"+
"<input type='text' name='userid' id='userid' value='' class='logon required' placeholder='Username' /></div>"+
"<div data-role='fieldcontain'><label for='password' id='lpassword'>Password *:</label><input type='password' name='password' id='password' class='logon required' value='' placeholder='Password' /></div>"+
"<div data-role='fieldcontain'><fieldset class='ui-grid-a'><a data-role='button' id='loginbtn' data-theme='b'>Login</a></fieldset></div></div></div>";
将标题和内容附加到页面。
$(document).ready(function(){
$('#pagecontent').append(_header).trigger("pagecreate");
$('#pagecontent').append(_content).trigger("pagecreate");
}
我可以在 chrome 中获得登录屏幕,但不能在移动设备和 Mozilla firefox 上
你能帮我解决这个问题吗?