Skip to content

Instantly share code, notes, and snippets.

@exclusiveTanim
Created May 26, 2014 06:45
Show Gist options
  • Save exclusiveTanim/36be3dcf1deab4affb13 to your computer and use it in GitHub Desktop.
Save exclusiveTanim/36be3dcf1deab4affb13 to your computer and use it in GitHub Desktop.
Change the displayed window title
/*If we want to change the displayed window title when a webView is loaded, we can use the following sample code. */
var win1 = Titanium.UI.createWindow({
title : 'Window 1',
backgroundColor : '#fff'
});
var webView = Ti.UI.createWebView({
url : "http://www.google.com"
});
win1.add(webView);
webView.addEventListener('load', function(e) {
var title = webView.evalJS("document.title");
win1.title = title;
});
win1.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment