Reputation: 449
I create a andriod application by Cordova (in vs).
I want to open a html file (from SDcard) by browser in android OS.
so i use under code (with InAppBrowser Plugin):
var path = cordova.file.externalRootDirectory + "file.html";
window.open(path, '_system');
but my problem is that the html file open by HtmlViewer Whereas i want open by browser.
how can do that?
Upvotes: 0
Views: 1167
Reputation: 870
try phonegap's file opener plugin https://github.com/pwlin/cordova-plugin-file-opener2
Upvotes: 1
Reputation: 417
Why don't you use document.write() instead of loading file ?
<script>
var html = "<html>" +
"<body>" +
"here's your html file content" +
"</body>" +
"</html>";
document.write(html);
</script>
Upvotes: 1