Created
November 1, 2014 01:36
-
-
Save addieljuarez/1ee4dd051f4726da48c8 to your computer and use it in GitHub Desktop.
fireEvent desde un html local
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
<!DOCTYPE html> | |
<html> | |
<header> | |
</header> | |
<body> | |
<div style="position: relative; top: 50px;"> | |
<input type="text" id="inputWeb"/> | |
<button id="botonWeb"> | |
click | |
</button> | |
</div> | |
<script> | |
var input = document.getElementById('inputWeb'); | |
var boton = document.getElementById('botonWeb'); | |
boton.addEventListener('click', function(e){ | |
Titanium.App.fireEvent('lanzadorWeb',{'valorInput' : input.value}); | |
}); | |
</script> | |
</body> | |
<footer> | |
</footer> | |
</html> |
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
$.index.open(); | |
Titanium.App.addEventListener('lanzadorWeb', function(e){ | |
var ventana2 = Alloy.createController('ventana2', {'valorArg2' : e.valorInput}).getView(); | |
ventana2.open(); | |
}); |
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
'.container':{ | |
backgroundColor:'#000', | |
} | |
'#webView':{ | |
url:'index.html', | |
} |
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 class="container"> | |
<WebView id="webView"></WebView> | |
</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
var args = arguments[0] || {}; | |
alert(args.valorArg2); | |
$.buttonClose.addEventListener('click', function(e){ | |
$.ventana2.close(); | |
}); | |
$.textoArgumentos.text = args.valorArg2; |
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
".container" : { | |
backgroundColor:'#000', | |
} | |
'#textoArgumentos':{ | |
color:'#fff', | |
font:{ | |
fontSize:30, | |
}, | |
} | |
'#buttonClose':{ | |
top:30, | |
height:50, | |
width:150, | |
title:'cerrar', | |
borderColor:'#fff', | |
color:'#fff', | |
} |
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 class="container"> | |
<Button id="buttonClose"></Button> | |
<Label id="textoArgumentos"></Label> | |
</Window> | |
</Alloy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment