I'm using Jquery plugin ZClip or ZeroClipboard which copies content to the clipboard via a button or link. The data to copy and links/buttons to activate this are loaded using ajax which needs to use plugin, I attach the elements after they have loaded as so:
$('#ajaxbutton').live('click', function() {
$.ajax({
type: "POST",
url: "ajax.php",
success: function(msg){
$('a.ajaxcopymulti').zclip({
path:'js/ZeroClipboard.swf',
copy:function(){
return $('p#ajaxdescription').text();
}
});
});
});
and in ajax.php for example:
<p id="ajaxdescription">Ajax description copied to clipboard</p>
<p><a href="#" id="ajaxcopy">Click here to copy the above text</a></p>
Works for all other browsers but IE 7 and IE 8. I get this error:
Unknown Runtime Error: ZeroClipboard.js, line 135 character 3
So in the plugin code I change:
this.div.innerHTML = this.getHTML(box.width, box.height);
to:
$(this.div).html( this.getHTML( box.width, box.height ) );
Which gets rid of the runtime error, but nothing appears to be copied into the clipboard for IE 7 and 8. Is anyone familiar enough with this to give some help? Thanks.