问题
I'm loading a remote page into a Cordova app using:
window.location = "http://myfoosite.net"
The local Cordova app has some plugins set up and the remote page has cordova.js loaded into it. It seems to work fine as I can hook in to the deviceready event on the remote page and add an EventListener for 'backbutton', for example.
If I call out to a plugin locally, it works fine:
navigator.notification.alert("wooo", null);
... but not from the remote page.
Is there any way to call out to plugins from remote pages?
回答1:
it is not possible to call cordova plugins call in remote pages. but you can make use of Inappbrowser phonegap plugin to implement this.
Inappbrowser provide callback function which you can you use as per requirement.
For more info on this go to below url
http://docs.phonegap.com/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html
Hope this helps.. Thanks
来源:https://stackoverflow.com/questions/23913936/calling-phonegap-cordova-plugin-functions-from-remote-web-page