Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. Application Error:
  2.  
  3. net::ERR_UNKNOWN_URL_SCHEME(twitter://user?screen_name=xerxesnoble)
  4.  
  5. //If Android
  6.  
  7. var ua = navigator.userAgent.toLowerCase();
  8. var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
  9.  
  10. if (isAndroid) {
  11.  
  12. alert('Android!');
  13.  
  14. twitterCheck = function() {
  15. alert('Android!');
  16. var now = new Date().valueOf();
  17.  
  18. setTimeout(function () {
  19. if (new Date().valueOf() - now > 100) return;
  20. window.open('https://play.google.com/store/apps/details?id=com.twitter.android', '_system', 'location=no');
  21. }, 50);
  22.  
  23. window.open('twitter://user?screen_name=XerxesNoble', '_system', 'location=no');
  24. };
  25. };
  26.  
  27. $('.twiterNav').click(function() {
  28. window.open('twitter://user?screen_name=xerxesnoble', '_system', 'location=no');
  29. });
  30.  
  31. //Twitter checker
  32.  
  33. // If Mac//
  34.  
  35. var twitterCheck = function(){
  36.  
  37. appAvailability.check('twitter://', function(availability) {
  38. // availability is either true or false
  39. if(availability) { window.open('twitter://user?screen_name=xerxesnoble', '_system', 'location=no');}
  40. else{window.open('https://itunes.apple.com/ca/app/twitter/id333903271?mt=8', '_system', 'location=no'); };
  41. });
  42. };
  43.  
  44. //If Android
  45.  
  46. var ua = navigator.userAgent.toLowerCase();
  47. var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
  48.  
  49. if(isAndroid) {
  50.  
  51. twitterCheck = function(){
  52.  
  53. appAvailability.check('com.twitter.android', function(availability) {
  54. // availability is either true or false
  55. if(availability) {window.open('twitter://user?screen_name=xerxesnoble', '_system', 'location=no');}
  56. else{window.open('https://play.google.com/store/apps/details?id=com.twitter.android', '_system', 'location=no');};
  57. });
  58. };
  59. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement