2016-06-09 37 views
0

Jquery Mobile庫在我的主機上無法正常工作。我也嘗試通過CDN鏈接它,但我得到更多的錯誤。jQuery Mobile無法在godaddy服務器上工作

<!DOCTYPE html> 
<html> 
<head> 
    <title></title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="css/jqmobile.css"> 
    <script type="text/javascript" src="js/jqmobile.js"></script> 
    <script type="text/javascript" src="js/jquery.js"></script> 
</head> 
<body> 
    <div data-role='page' id='first-page'> 
     first page 
    </div> 
    <div data-role='page' id='second-page'> 
     second page 
    </div> 
</body> 
</html> 

輸出I從這個代碼得到的是:

first page 
second page 

,我從控制檯得到我的錯誤是:

Cannot set property 'mobile' of undefined 

browse.php?u=http%3A%2F%2Fpickfour.com%2Fjs%2Fjqmobile.js&b=4:5Uncaught TypeError: 

它看起來像在這一行中出現錯誤在我的jqmobile.js文件中。

{!function(a){a.mobile={}}(a),function(a,b){function d(b,c){var d,f,g,h=b.nodeName.toLowerCase();return"area"===h?(d=b.parentNode,f=d.name,b.href&&f&&"map"===d.nodeName.toLowerCa 

我打電話給我的託管服務提供商支持,但它沒有幫助,我一直在這一天了。任何幫助表示讚賞。

+2

jquery是否需要在您的之前的jquery mobile之前添加? – steve

回答

0

你的問題不太可能與Go Daddy作爲託管服務提供商有任何關係。

在對代碼進行第一次檢查時,突出的是在調用jquery之前調用jQuery mobile。由於jQuery Mobile對jQuery有依賴性,我懷疑這是你的問題。

如果採取看看jQuery Mobile的文檔quick start guide你可以看到這是說明:

<head> 
<title>My Page</title> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> 
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> 
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script> 
</head> 

我懷疑解決這個將整理您的問題。

相關問題