Jquery mobile,无法使用$ .mobile.changePage来更改页面

我使用以下代码以编程方式更改我的应用程序中的页面与phonegap:

$('#selection').change(function() { alert($(this).val()); $.mobile.changePage($("#about"), "slideup"); }); 

当用户更改选择时,警报将触发,理论上应将它们发送到以下jquery对象。

  

About Us

Information about the company

该对象在正常链接时工作正常

 About Us 

但我不能让它在浏览器或手机间隙加载程序。

有任何想法吗? 我必须查找API一百万次。

完整的HTML如下:

    Header       // PhoneGap is loaded and it is now safe to make calls PhoneGap methods // function onDeviceReady() { function reachableCallback(reachability) { // There is no consistency on the format of reachability var networkState = reachability.code || reachability; var states = {}; states[NetworkStatus.NOT_REACHABLE] = 'No network connection'; states[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection'; states[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection'; alert('Connection type: ' + states[networkState]); } navigator.network.isReachable('phonegap.com', reachableCallback); }     
<h1 header

Thank you for downloading our app

choice1

About Us

Information about the company

您正在使用jquery-mobile 1.0 alpha 1,它看起来有一个截然不同的API。 例如,changePage具有以下签名[1]:

 function changePage( from, to, transition, back ) 

我假设(虽然没试过)你可以使用as

 $.mobile.changePage($('#home'), $('#about'), 'slide-up', false); 

虽然我认为升级到1.0 beta2(最新版本)会更好,除非与手机屏幕不兼容会让你无法使用它(据我所知,没有任何内容)。 如果升级,您的上述代码应该可以正常运行。

。[1]: https : //github.com/jquery/jquery-mobile/blob/1.0a1/js/jquery.mobile.js#L159

我认为您需要选项作为对象而不是字符串。

所以也许尝试使用以下代码:

 $.mobile.changePage($("#about"), { transition: "slideup"});