Created
February 27, 2012 03:39
-
-
Save hisasann/1921157 to your computer and use it in GitHub Desktop.
TitaniumMobileでWebViewを使う方法
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 WebView = function() { | |
// window | |
var win = Ti.UI.createWindow(); | |
// view | |
var view = Ti.UI.createView(); | |
// webview | |
var webview = Ti.UI.createWebView(); | |
webview.url = 'http://www.google.co.jp/'; | |
// loadイベント | |
webview.addEventListener('load', function(e) { | |
Ti.API.log('loaded'); | |
// ここでHTMLを改変! | |
webview.evalJS('document.getElementById("lst-ib").value = "ひささん";'); | |
}); | |
view.add(webview); | |
win.add(view); | |
return win; | |
} | |
module.exports = WebView; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment