2012-02-06 4 views
3

Blackberry 게임 북에서 window.history.back이 작동하지 않습니다.Phonegap navigator.app.backHistory/window.history.back가 Blackberry 게임 플레이에서 작동하지 않습니다.

"Error: Status=2 Message=Class App cannot be found" 
: 시뮬레이터 .... 그래서

에서 테스트, 나는 index.html을

window.history.back = navigator.app.backHistory; 

이것은 폰갭 기능을 제어 할 수 있지만, 런타임에이 오류가 발생합니다이 시도

/** 
* Navigate back in the browser history. 
*/ 
App.prototype.backHistory = function() { 
    // window.history.back() behaves oddly on BlackBerry, so use 
    // native implementation. 
    console.log("in backHistory"); 
    PhoneGap.exec(null, null, "App", "backHistory", []); 
}; 

상관 단서 : 여기

은 폰갭 (1.4.1) 함수? 이 질문에 대답하는 경우

function goBack(){ 
    if (typeof (navigator.app) !== "undefined") { 
     navigator.app.backHistory(); 
    } else { 
     window.history.back(); 
    } 
} 

나는 잘 모르겠지만, 나는이 대신 window.history.back 덮어 쓰기의

답변

6

, 당신은 함수가 정의에 따라 행동 할 수있는 다시 일반적인 기능을 쓸 수있다 이 방법을 사용하여 모바일 장치와 데스크톱 브라우저에서 테스트 할 수있었습니다.