2011-11-28 58 views
2

我用phonega + jquerymobile開發一個程序。 phonegap開始與本地page.i需要加載一些外部頁面。所以,我用使用phonegap + jquery mobile加載外部鏈接,這個history.back不起作用?

$.mobile.changePage("some url"); 

加載外部page.could外部page.when用戶導航不使用history.back();背上一頁。該程序喜歡崩潰並退出。
BTW,我使用的logcat發現了一個錯誤信息:

E/Web Console(334): SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent. at  
file:///android_asset/www/js/jquery.mobile-1.0.js:3536 
In line 3536 of jquery.mobile-1.0.js: history.replaceState(state, document.title, href); 

回答

0

我有一個黑客。我發現沒有其他的辦法來解決這個問題,在我的應用程序,所以我把它包:

history.replaceState(state, document.title, href); 

try{history.replaceState(state, document.title, href);}catch(e){} 

此丟棄錯誤,並且應用程序仍然表現良好。在你自己的危險中使用它。