Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZeroClipboard not working on mobile version of the site

I have implemented ZeroClipboard functionality on our site - http://couponvoodoo.com/rcp/Jabong.com/coupons-offers?field_offer_type_tid=All I am using Drupal-7

It is working fine on the desktop version but not working on the mobile version of the site. I have put the following code in the footer :

<script type="text/javascript">
copy_coupon_footer();
function copy_coupon_footer(){
var divArray = document.getElementsByClassName("unlock_best_coupon");
for (var i = 0, len = divArray.length; i < len; ++i) {
var offer_type = divArray[i].getAttribute('data-clipboard-text');
// alert('offer_type '+offer_type );
try{
       var id = divArray[i].getAttribute( 'id' );
      var client = new ZeroClipboard( document.getElementById(id), {moviePath:'/moviePath' } ); 
      client.on( 'load', function(client) { 
       client.on( 'complete', function(client, args) {try{
      var url = this.getAttribute("href");
       var coupon_code = url.split('&c=')[1].split('&')[0];
       this.innerHTML = coupon_code;
       var classname = this.className+' copied_coupon';
       this.setAttribute("class",classname);
//     window.open(url,'_blank');
     window.location.href = url;
       }catch(e){}
       } );
      } );

     }catch(e){alert(e.message);}
  }
     return false;
  }

</script>
like image 679
user2129794 Avatar asked Feb 18 '14 06:02

user2129794


1 Answers

ZeroClipboard requires Adobe Flash in order to perform it's clipboard function and thus it will not work in any browser that does not have Adobe Flash installed.

So, since there are hardly any mobile devices with Adobe Flash (only a few older Android devices), it won't work on mobile devices.

When I asked this question about an alternative to ZeroClipboard that doesn't require Adobe Flash, no other solutions were offered.

like image 114
jfriend00 Avatar answered Sep 24 '22 23:09

jfriend00