Hi Aeneas,
q1:
pre
Will this code still work when running code from browser or do I need to check first and change back to other way?
/pre
Unfortunatly nope. You need to use separate solutions for web app and native app.
Here is a little hint about condition:
pre
var wnd = window.open("about:blank","_blank","directories=no,status=no,menubar=no,scrollbars=no,resizable=no,EnableViewPortScale=yes");
if(wnd.document){
//here code for browser
}
else{
//here code for inappbrowser
}
/pre
q2:
can not tell you about your code need to test.. So please use give above code:
precode
var invhtml = '<div style="background: red;">hello world<>';
var wnd = window.open("about:blank","_blank","directories=no,status=no,menubar=no,scrollbars=no,resizable=no,EnableViewPortScale=yes");
wnd.addEventListener( "loadstop", function() {
wnd.executeScript({ code: 'document.write(' + invhtml + ');' });
});
/code/pre
After you will get this code to work - you can change "invhtml" variable with your HTML data.
Regards.