Software Archive
Read-only legacy content
17061 Discussions

Open a link from my app

xkevin
New Contributor I
286 Views

What is the code for opening a link 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.mysite.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>

 

0 Kudos
1 Reply
Elroy_A_Intel
Employee
286 Views

In order to display a web page in your application, I recommend using the https://www.npmjs.com/package/cordova-plugin-inappbrowser Cordova plugin. You can find examples their as well. This plugin is part of the Core Plugins in Intel XDK currently.

0 Kudos
Reply