JAVASCRIPT   9

detect-os.js

Guest on 15th May 2021 10:14:09 AM

  1. if ( (navigator.userAgent.indexOf('Android') != -1) ) {
  2.         document.getElementById('installTxt').innerHTML ='<strong>AVON Costa Rica</strong> para Android <a href="https://play.google.com/store/apps/details?id=cr.avon"><button type="button" class="btn btn-primary">Instalar</button></a>';
  3. } else if ( (navigator.userAgent.indexOf('iPhone') != -1) ||
  4.             (navigator.userAgent.indexOf('iPod') != -1) ||
  5.             (navigator.userAgent.indexOf('iPad') != -1)) {
  6.         document.getElementById('installTxt').innerHTML ='<strong>AVON Costa Rica</strong> para iOS <a href="https://geo.itunes.apple.com/cr/app/avon-costa-rica/id1043773965?mt=8"><button type="button" class="btn btn-primary">Instalar</button></a>';
  7. } else {
  8.   document.getElementById('installTxt').innerHTML ='Busc&aacute; la aplicaciĆ³n <strong>AVON Costa Rica</strong> para dispositivos m&oacute;viles Android y iOS'S';
  9. }
  10.  
  11. function hiddenBlock() {
  12.     document.getElementById("installBlock").classList.add("hidden");

Raw Paste


Login or Register to edit or fork this paste. It's free.