0

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?

2 Answers 2

1

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>
Sign up to request clarification or add additional context in comments.

Comments

1

try phonegap's file opener plugin https://github.com/pwlin/cordova-plugin-file-opener2

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.