What is the code for opening a link in browser from my app, best for updated version of intel xdk and cordova plugin. I am using a cross-website.
Currently this is my code, but ain't work'n.
<script>
function join_browser(){
var ref = window.open('https://www.example.com/join', '_blank', 'location=yes');
ref.addEventListener('loadstart', function(event) { alert('start: ' + event.url); });
ref.addEventListener('loadstop', function(event) { alert('stop: ' + event.url); });
ref.addEventListener('loaderror', function(event) { alert('error: ' + event.message); });
ref.addEventListener('exit', function(event) { alert(event.type); });
}
</script>
<label class="text-style text-center">No account? <a href="#" onclick="join_browser(); return false;"> Register here. </a>
</label>
I recommend using
var url = "http://google.com";
window.open(url, '_system');
Tested on Android and iOS platforms. Alternatively you can also use InappBrowser plugin of cordova.