Created
May 26, 2014 06:45
-
-
Save exclusiveTanim/36be3dcf1deab4affb13 to your computer and use it in GitHub Desktop.
Change the displayed window title
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
/*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