Last active
August 29, 2015 14:14
-
-
Save pegli/fbf4d0837cbbefb69db7 to your computer and use it in GitHub Desktop.
Alloy WebView example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.win.open(); | |
function webviewLoad() { | |
alert("loaded"); | |
} | |
function loadGoogle() { | |
$.webview.url = "http://google.com/"; | |
} | |
function loadAmazon() { | |
$.webview.url = "http://amazon.com/"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Alloy> | |
<Window id="win"> | |
<WebView id="webview" top="24" onLoad="webviewLoad"/> | |
<Toolbar bottom="0"> | |
<Items> | |
<Button title="Google" onClick="loadGoogle"/> | |
<Button title="Amazon" onClick="loadAmazon"/> | |
</Items> | |
</Toolbar> | |
</Window> | |
</Alloy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.win.open(); | |
function webviewLoad() { | |
alert("loaded"); | |
} | |
function openChild() { | |
var view = Alloy.createController('child').getView(); | |
view.open(); | |
$.win.close(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Alloy> | |
<Window id="win"> | |
<WebView id="webview" url="http://yahoo.com/"/> | |
<Toolbar bottom="0"> | |
<Items> | |
<Button title="Open Child" onClick="openChild"/> | |
</Items> | |
</Toolbar> | |
</Window> | |
</Alloy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment