Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery - deeplink for app from browser

0 votes
1 view
added Feb 12 in jQuery by lcjr Sergeant (2,120 points)
$(AppBanner).click(function () {
  if($('body').hasClass('page-content')) {
      window.location = 'lazacodeorg://story/' + newsId;
  } else {
      setTimeout(function() {
          window.open(AppUrl);
      }, 100);
      window.location = 'lazacodeorg://story/' + newsId;
  }
});

var AppArea = 'body.one-sidebar',
  AppBanner = $('#app-banner'),
  newsUrl = window.location.href,
  newsSplit = newsUrl.split('/'),
  newsId = newsSplit[newsSplit.length-2],
  AppUrl = 'https://www.lazacode.org/appstore'; 

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...