Skip to content

Instantly share code, notes, and snippets.

@yanguango
Created December 23, 2010 11:38
Show Gist options
  • Save yanguango/752863 to your computer and use it in GitHub Desktop.
Save yanguango/752863 to your computer and use it in GitHub Desktop.
Ti.App.addEventListener('openUrl', function(data){
var win = Ti.UI.createWindow({});
var newWebView = Ti.UI.createWebView({
url: data.url,
scalesPageToFit: true
});
win.add(newWebView);
Ti.UI.currentTab.open(win,{animated:true});
return false
});//open in new window
Ti.App.addEventListener('openUrl', function(e){
Ti.Platform.openURL(e.url);
});//open in safari,will jump out the app
Ti.App.addEventListener('fillNews', function(passedData)
{
contentView.evalJS("$('a').bind('click',function(){Ti.App.fireEvent('openUrl', { url: $(this).attr('href')});return false;})");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment