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 [URL=”http://code.google.com/p/zeroclipboard/”]ZeroClipboard
HTML CODE (this works perfect with the clipboard() function)
[CODE]<label>Image link: </label><input id=”photo_direct_link” value=”test” />
CLIPBOARD FUNCTION
[CODE]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();
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 movie ?
AJAX
[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”);
I hope somebody can help me because I am searching quite some time to resolve this issue.
Greetings,
Christophe