var user_url = 'ngw', admin_url = 'admin'; window.hanReload = function(){ console.log("Log of hanreload...."); var fnProcess = function(e){ if(!(window.location.hash.indexOf("iphone") !== -1)) { window.location.reload(); } else { window.location.href = "hybrid.html"; } } try{ var appcache = angular.element("#wrapper").injector().get("appcache"), $timeout = angular.element("#wrapper").injector().get("$timeout"), $rootScope = angular.element("#wrapper").injector().get("$rootScope"); $timeout(function(){ $rootScope.isBlocked = true; }) fnProcess(); } catch(e){fnProcess()} }