Skip to content

Instantly share code, notes, and snippets.

@hisasann
Created February 27, 2012 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hisasann/1921157 to your computer and use it in GitHub Desktop.
Save hisasann/1921157 to your computer and use it in GitHub Desktop.
TitaniumMobileでWebViewを使う方法
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