2

我正在爲使用jQuery Mobile的Windows Phone 7開發Web應用程序。Windows Phone 7中的頁面導航Web App

我想導航到一個頁面,說index.html到sample.html。

function sample() 
{ 
    window.location.href = "Sample.html"; 
    navigator.notification.alert("Navigated);    
} 

它工作正常。

但是,當加有一個查詢字符串 「sample.html?ID = 123123」

function sample() 
    { 
     window.location.href = "Sample.html?id=123123"; 
     navigator.notification.alert("Navigated");    
    } 

此導航不起作用。

任何人都可以請guide.Any其他導航方法與查詢字符串也歡迎。

+0

不工作這意味着它ð沒有導航,或者id屬性是未定義的? – 2012-01-17 07:28:54

+0

@willmel該頁面並不是實例化頁面。 – siva 2012-01-17 08:34:13

回答

6

我們不能使用PhoneGap的Windows Phone的Web應用程序使用的查詢字符串7 相反,我們可以使用Sample.html#12312

0

什麼是txt?看起來它可能在您嘗試訪問txt.value時拋出異常,因爲txt爲空。我想這是頁面上的文本框,所以你必須訪問它像$("input#txt").val();代替

+0

其實txt只是一個例子。我們可以硬編碼querystring'Sample.html?id = 123123' – siva 2012-01-17 11:48:42

0

在PhoneGap的Windows Phone應用程序應該是這樣的:

document.location = "Sample.html#id=123123"; 

或者:

window.location.href = "Sample.html#id=123123";