Hello,
Does anybody know why flash doesn't work on content dynamically loaded via AJAX? This is for a one-click CopyToClipboard function. I use ZeroClipboard for this.
HTML CODE (this works perfect with the clipboard() function)
CLIPBOARD FUNCTIONCode:<label>Image link: </label><input id="photo_direct_link" value="test" />
But then when I load the input via AJAX and call the clipboard() function, the input is loaded but it doesn't convert to a Flash movieCode:function clipboard() { // Copy to clipboard var photo_direct_link = new ZeroClipboard.Client(); photo_direct_link.setText( '' ); // will be set later on mouseDown photo_direct_link.setCSSEffects( true ); photo_direct_link.addEventListener( 'complete', function(client, text) { copiedToClipboard('Image link'); } ); photo_direct_link.addEventListener( 'mouseDown', function(client) { // set text to copy here photo_direct_link.setText( document.getElementById('photo_direct_link').value ); } ); photo_direct_link.glue( 'photo_direct_link' ); } clipboard();
AJAX
I hope somebody can help me because I am searching quite some time to resolve this issue.Code:$.post("/get_flash_input/", {'file_id' : fileId}, function(data) { $('#flashInput').append('<label>Image link: </label><input id="photo_direct_link" value="' + /*data.image_link*/ 'test' + '" /><br />'); // Call the clipboard function clipboard(); }, "json");
Greetings,
Christophe



Reply With Quote

Bookmarks