问题
I am using Cordova 3.4.1 on iOS with the InAppBrowser plugin version 0.4.0.
When I have an <a href="...." target="_blank">
element, it is supposed to open in the InAppBrowser but it doesn't. Instead in replaces my app in the CordovaWebView and I have no way of getting back to the app.
if I do window.open it seems to work fine, but it isn't really feasible for me to add onclick handlers to all my links to then open them up in the InAppBrowser.
回答1:
This seems to be by design as per this bug... https://issues.apache.org/jira/browse/CB-6747
回答2:
To open in the InAppBrowser your link needs to be formatted like this<a href="#" onclick="window.open('http://myurl.com', '_blank', 'location=no');">
. I hope that helps.
回答3:
Try using the target="_system"
which should use the device's default browser
来源:https://stackoverflow.com/questions/23835720/cordova-inappbrowser-and-a-target-blank-not-working