我有我的插件(inappbrowser
)和cordova
安裝。我也使用window.open = cordova.InAppBrowser.open;
命令來定位window.open
,如我在html文件中d更新的版本所記錄的,但只有我的web視圖可以工作,而inapp瀏覽器不能。使用inappbrowser和最新的cordova 5.4.x版本
同樣的NetBeans在聲明中
window.open = cordova.InAppBrowser.open;
在d線帶來的錯誤指示使用時寫出科爾多瓦不聲明爲全局變量
需要完整的教程,以使最新的科爾多瓦inappbrowser工作。
我的index.html是遵循
這是我的index.html
<!DOCTYPE html>
<html>
<head>
<title>Primrose AVR</title>
<script type="text/javascript" >
document.addEventListener("deviceready", onDeviceReady, false);
enter code here
window.open = cordova.InAppBrowser.open;
var iabRef = null;
function iabLoadStart(event) {
alert("Loading : " + event.type);
}
function iabLoadStop(event) {
alert("loaded : " + event.type);
}
function iabLoadError(event) {
alert("Error loading: " + event.type);
}
function iabClose(event) {
alert(event.type);
iabRef.removeEventListener('loadstart', iabLoadStart);
iabRef.removeEventListener('loadstop', iabLoadStop);
iabRef.removeEventListener('loaderror', iabLoadError);
iabRef.removeEventListener('exit', iabClose);
}
function onDeviceReady() {
// IN THE NEXT LINE WHERE cordova.InAppBrowser.open(); IS USED //(NETBEANS PROMPT THAT CORDOVA IS NOT DECLARED AS A GLOBAL VARIABLE //VARIABLE),THEREFORE MAKING THE LINE IRRELEVANT AND WITH ERROR
cordova.InAppBrowser.open('https://kyc.fcmb.com/PrimroseMobile/Security/SignInMobile.aspx/', '_self', 'location=yes');
iabRef.addEventListener('loadstart', iabLoadStart);
iabRef.addEventListener('loadstop', iabLoadStop);
iabRef.addEventListener('loaderror', iabLoadError);
iabRef.addEventListener('exit', iabClose);
}
</script>
</head>
<body onload=" onDeviceReady()">
</body>
</html>
MY config.xml文件
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" id="com.coolappz.PrimroseAvr" version="1.0.0">
<name>Primrose Avr</name>
<description>
Application that works as an inappbrowser and webview.
</description>
<author email="[email protected]" href="http://gmail.com">
Badmus akintoba
</author>
<content src="index.html"/>
<preference name="permissions" value="none" />
<preference name="webviewbounce" value="false" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#0177C6" />
<preference name="detect-data-types" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="android-minSdkVersion" value="14" />
<preference name="android-targetSdkVersion" value="22" />
<preference name="phonegap-version" value="cli-5.1.1" />
<preference name="SplashScreenDelay" value="10000" />
<preference name="SplashScreen" value="screen" />
<platform name="android">
<icon src="www/logo.png" density="ldpi" />
<icon src="www/logo.png" density="mdpi" />
<icon src="www/logo.png" density="hdpi" />
<icon src="www/logo.png" density="xhdpi" />
<icon src="www/logo.png" density="xxhdpi" />
<icon src="www/logo.png" density="xxxhdpi" />
<splash src="www/al.png" density="land-hdpi"/>
<splash src="www/ll.png" density="land-ldpi"/>
<splash src="www/ml.png" density="land-mdpi"/>
<splash src="www/al.png" density="land-xhdpi"/>
<splash src="www/al.png" density="land-xhdpi"/>
<splash src="www/al.png" density="land-xhdpi"/>
<splash src="www/ap.png" density="port-hdpi"/>
<splash src="www/lp.png" density="port-ldpi"/>
<splash src="www/mp.png" density="port-mdpi"/>
<splash src="www/ap.png" density="port-xhdpi"/>
<splash src="www/ap.png" density="port-xxhdpi"/>
<splash src="www/ap.png" density="port-xxxhdpi"/>
</platform>
<plugin name="cordova-plugin-whitelist" spec="1"/>
<access origin="*"/>
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" />
</feature>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<allow-intent href="market:*"/>
</platform>
</widget>
最後,我有我的INAPPBROWSER PLUGIN安裝,但YET INAPPBROWSER IS NOT WORKING
PLS專家幫助我使用NETBEANS IDE開發AN DROID APP
http://stackoverflow.com/help/how-to-ask –