3
phonegap
android app에 원격 HTML을로드하는 방법을 찾고 있습니다. super.loadUrl("file:///android_asset/www/hello.html");
을 사용하고 있지만 원격 HTML 페이지를로드하는 방법은 무엇입니까?phonegap : 원격 HTML로드
phonegap
android app에 원격 HTML을로드하는 방법을 찾고 있습니다. super.loadUrl("file:///android_asset/www/hello.html");
을 사용하고 있지만 원격 HTML 페이지를로드하는 방법은 무엇입니까?phonegap : 원격 HTML로드
은 매우 간단 벤 카트의,
단지, HTTP 요청과
super.loadUrl("http://www.test.com/test1.html");
필요한 HTML 페이지를로드 또는 당신은 당신이했던 것처럼 로컬 HTML 파일을로드 할 수 있습니다
super.loadUrl("file:///android_asset/www/hello.html");
및 hello.html에서 onLoad()에서 window.location
을 사용하면 javascript 함수가 외부 HTML 페이지를로드하십시오.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- Change this if you want to allow scaling -->
<meta name="viewport" content="width=default-width; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>LoadUrl
<script type="text/javascript" charset="utf-8">
function onBodyLoad()
{
document.addEventListener("deviceready",onDeviceReady,false);
}
/* When this function is called, PhoneGap has been initialized and is ready to roll */
function onDeviceReady()
{
// do your thing!
window.location="http://170.60.26.20:8099/Sencha/Html/index.html";
}
</script>
</head>
<body onload="onBodyLoad()">
</body>
</html>
안드로이드 매니페스트 파일에 인터넷 사용 권한을 설정했는지 확인하십시오.
window.location은 크롬이 아닌 페이지를 엽니 다. – ProgramCpp