Sunday 15 January 2012

javascript - ZeroClipboard - Check if it wasn't loaded -



javascript - ZeroClipboard - Check if it wasn't loaded -

really simple question here, couldn't find in documentation, hoping here point me in right direction.

https://github.com/zeroclipboard/zeroclipboard

in zeroclipboard there's callback when swf loaded, there way can observe if hasn't been loaded?

here's how works when it's loaded:

client.on( "ready", function( readyevent ) { // alert( "zeroclipboard swf ready!" ); client.on( "aftercopy", function( event ) { // `this` === `client` // `event.target` === element clicked event.target.style.display = "none"; alert("copied text clipboard: " + event.data["text/plain"] ); } ); } );

simply check whether zeroclipboard object exist in window

window.onload = function() { if (!('zeroclipboard' in window)) { //your code } }

javascript jquery zeroclipboard

No comments:

Post a Comment