解决关于jquery mobile databox日期插件手机上失效的问题

不废话,直接上代码,修改前的代码:


<span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><html>
<head>
	<title>密码修改</title> 
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="../css/jquery.mobile-1.0.1.min.css">  
	<script src="../js/jquery-1.7.1.min.js"></script>
    <script src="../js/jquery.mobile-1.0.1.min.js"></script>   	
    
    <span style="color: #ff0000;"><link rel="stylesheet" href="../css/jquery.mobile.datebox.min.css">
    <script src="../js/jquery.mobile.datebox.min.js"></script> </span>
</head>
<body>
    <div data-role="page">   
       <div data-role="content" class="content">
        <label for="mydate">生日:</label>
        <input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode": "datebox"}'>	        	
       </div>
    </div>
</body>
</html></span></span></span>

修改后的代码,手机phonegap打包显示正常:

<span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><!DOCTYPE HTML>
<html>
<head>
	<title>密码修改</title> 
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="../css/jquery.mobile-1.0.1.min.css">  
	<script src="../js/jquery-1.7.1.min.js"></script>
    <script src="../js/jquery.mobile-1.0.1.min.js"></script>   	
    
</head>
<body>
    <div data-role="page">   
    <span style="color: #ff0000;"><link rel="stylesheet" href="../css/jquery.mobile.datebox.min.css">
    <script src="../js/jquery.mobile.datebox.min.js"></script> </span>
    
       <div data-role="content" class="content">
        <label for="mydate">生日:</label>
        <input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode": "datebox"}'>	        	
       </div>
    </div>
</body>
</html></span></span></span>



对此问题,我个人觉得是由于jquerymobile页面链接加载的时候,采用了ajax异步加载,整个页面不重新刷新,所以我把它写在head里面,并没有引用进来,而需要写在page里面。


你可能感兴趣的:(jquery,mobile,datebox,phonegap失效,浏览器正常)