Skip to content

Instantly share code, notes, and snippets.

@alanleard
Created March 16, 2015 19:15
Show Gist options
  • Save alanleard/cf176ff6a21b1053805a to your computer and use it in GitHub Desktop.
Save alanleard/cf176ff6a21b1053805a to your computer and use it in GitHub Desktop.
Using DOM calls from Appcelerator MobileWeb
function doClick(e) {
if(OS_MOBILEWEB){
var btn=document.createElement("BUTTON");
btn.style.position='absolute';
var t=document.createTextNode("CLICK ME");
btn.appendChild(t);
document.body.appendChild(btn);
}
}
$.index.open();
<Alloy>
<Window class="container" layout="vertical">
<Button onClick="doClick">add web button</Button>
</Window>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment