Software Archive
Read-only legacy content
17061 Discussions

How to load a Webpage within a web view in Intel XDK

Olushola_O_
Beginner
338 Views

Can someone please teach me how to load a webpages within my mobile app ? which will display when I build for android and wp8?

I recall doing this with dreamweaver and it was perfect..Intel XDK i don't know

0 Kudos
1 Reply
Akhil_R_
Beginner
338 Views

With just one line of code you can open browser inside a Intel XDK app.

//Parameters:
//1. Url of the website.
//2&3. Portrait X and Y position of the close button.
//4&5. Landscape X and Y position of the close button.
//6&7. Height and width of the close button. 
intel.xdk.device.showRemoteSiteExt("http://www.google.com/",280,0,50,50,60,60);

//This event is fired when the browser is closed.
window.addEventListener("intel.xdk.device.remote.close", function(){});

The webpage is actually displayed in a new webview. When the close button in the new webview is clicked it returns to the original web view.

This function only works inside event handlers. So you can’t just call it whenever you like to. For example:

document.addEventListener(“intel.xdk.device.ready”,function(){
intel.xdk.device.showRemoteSiteExt(“http://www.google.com/”,280,0,50,50,60,60);
},false);

Make sure you have also added Intel XDK Device plugin in your app.

0 Kudos
Reply