Refresh Webview
My application opens up so that the tab goes to a webview. Below is the code that I have been using to open up the external url however once the program is open, I can't seen to figure out how to get it so that every time the tab is selected, it refreshes the webview
var window = Titanium.UI.currentWindow;
var webview = Titanium.UI.createWebView({url:'http://www.name.com/mobile'});
window.add(webview);
2 Answers
-
Try this
webview.reload();
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.WebView.reload-method.html
-
The function is webview.reload(), but the trick you need is to call the reload function within an event.
So, add a listen event that reloads the page when the tab in question gets focus.
I have it in some code somewhere, so if that doesn't help, let me know and I'll dig it up.
Peter Janett
http://www.newmediaone.net