解決關於jquery mobile databox日期插件手機上失效的問題

不廢話,直接上代碼,修改前的代碼: css


<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打包顯示正常: html

<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裏面。
相關文章
相關標籤/搜索