2012-07-13 119 views
1

我正在爲BlackBerry Webworks,PhoneGap 1.9,Jquery和jquery mobile開發。 PhoneGap提供的示例在模擬器上正常工作,直到它包含jQuery庫,應用程序停止響應。Phonegap with jquery and jquerymobile for BB

添加代碼以瞭解情況。有人可以使用相同的技術?

1)

<!DOCTYPE HTML> 
<html> 
<head> 
<title>Prueba</title> 
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" /> 
<script type="text/javascript" src="js/json2.js"></script> 
<script type="text/javascript" src="js/cordova-1.9.0.js"></script> 
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> 
<script type="text/javascript" src="js/jquery.mobile-1.1.0.min.js"></script> 
</head> 
<body> 

<h3>Hello!</h3> 
</body> 
</html> 

=>結果:碰撞

2)使用jQuery版本1.6.4此篇(http://bugs.jquery.com/ticket/10608)

<!DOCTYPE HTML> 
<html> 
<head> 
<title>Prueba</title> 
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" /> 
<script type="text/javascript" src="js/json2.js"></script> 
<script type="text/javascript" src="js/cordova-1.9.0.js"></script> 
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script> 
<script type="text/javascript" src="js/jquery.mobile-1.1.0.min.js"></script> 
</head> 
<body> 

<h3>Hello!</h3> 
</body> 
</html> 

=>結果:碰撞

3)在不移動的jquery

<!DOCTYPE HTML> 
<html> 
<head> 
<title>Prueba</title> 
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" /> 
<script type="text/javascript" src="js/json2.js"></script> 
<script type="text/javascript" src="js/cordova-1.9.0.js"></script> 
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> 
</head> 
<body> 

<h3>Hello!</h3> 
</body> 
</html> 

=>結果:崩潰

4)在不jQuery Mobile的

<!DOCTYPE HTML> 
<html> 
<head> 
<title>Prueba</title> 
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" /> 
<script type="text/javascript" src="js/json2.js"></script> 
<script type="text/javascript" src="js/cordova-1.9.0.js"></script> 
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script> 
</head> 
<body> 

<h3>Hello!</h3> 
</body> 
</html> 

=>結果:作品!

但我需要jQuery的手機。謝謝你的幫助。

+0

你在測試什麼BlackBerry智能手機和操作系統? – JasonDScott 2012-07-16 00:41:02

+0

WebWorks的模擬器7.0.0.318 – Dani 2012-07-17 14:48:09

+0

您可以在實際設備上試用嗎?我注意到了模擬器的一些不確定性。 – JasonDScott 2012-07-17 15:00:50

回答

2

這個問題不是jQuery的移動文件(除非它是一個損壞的下載),因爲我已經在多個黑莓項目中使用相同版本的jQuery。

考慮檢查cordova-1.9和json2.js與PhoneGap 1.9和Blackberry的兼容性。

當然,在開發Blackberry時使用WebWorks SDK要簡單得多,因爲您可以使用更簡單的方法來處理黑莓手機(並且隨後移植到其他平臺時可以隨時剝離黑莓手機部件)。檢查出來:https://developer.blackberry.com/html5/(有很多有用的樣本)