问题
I am loading Website inside App using cordova.InAppBrowser.open('example.com', '_self', 'location=no,clearsessioncache=yes') and everything is works fine i.e it shows complete website mobile view inside the app, but now I am using some navigation inside assets\www\index.html file and when user will click on link the navaigation I want to load the website inside the div OR without losing the navigation.
function load_web(URL)
{
cordova.InAppBrowser.open(URL, '_self', 'location=no,clearsessioncache=yes');
}
<a href="javascript:load_web('example1.com')" >Web 1</a>
<a href="javascript:load_web('example2.com')" >Web 2</a>
回答1:
In other words, you want to show a non-fullscreen external site using Cordova's InAppBrowser. You can't do this, as it will always cover the entire app window. You have to use iframes for this, but this may or may not cause your app to be rejected by the store.
Notice that iframes and InAppBrowsers are becoming more and more restricted and eventually, Google and Apple could simply delete all apps using iframes and InAppBrowsers for the so-called security concerns paranoia. (and I wouldn't blame them, for the ill-use of iframes that we see everywhere)
来源:https://stackoverflow.com/questions/50306068/apache-cordova-load-external-url-or-website-inside-div