我正在开发PhoneGap构建中的测试应用程序。目前,我正在尝试在应用加载时重定向到一个页面。但是当我尝试这样做时,它不会重定向,而只能保留在index.html页面中。我正在使用TestObject来测试应用程序。Phonegap构建 - Javascript无法正常工作
的index.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" charset="utf-8">
function init() {
document.addEventListener("deviceready", onDeviceReady, true);
}
function onDeviceReady() {
alert("Device is ready");
}
</script>
</head>
<body onload="init();">
<input type="button" onclick="location.href='http://google.com';" value="Go to Google" />
Hai welcome to my app
</body>
</html>
config.xml中
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.mydomain.mobileApp"
versionCode = "1"
version = "1.0.0" >
<!-- versionCode is Android only -->
<!-- version is in major.minor.patch format -->
<name>My App</name>
<description>
An example for phonegap build app which wont show up in the playstore.
</description>
<author href="https://YourWebsite.com" email="[email protected]">
Name Of The Author
</author>
</widget>
当我测试这个浏览器,在单击按钮,它会重定向到http://google.com。但是当我上传apk(从phonebuild构建)并上传到TestObject时,按钮即将到来。但点击它没有任何反应。当我测试应用程序时,我越来越喜欢这个。
谁能帮我找到这个问题。提前致谢。
http://phonegap.com/getstarted/请按照教程和尝试指定你的问题。 –
你在使用phonegap-cli还是phonegap-app-desktop? –
@ HassanALi ..我使用phonegap build .. – Jenz