Skip to content

Instantly share code, notes, and snippets.

@grantges
Created September 4, 2014 17:59
Show Gist options
  • Save grantges/798ee95a756721f820d3 to your computer and use it in GitHub Desktop.
Save grantges/798ee95a756721f820d3 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