Mam pytanie co do funkcji, nie znam sie na javascript wogole i niewiem jak zamienic cos takiego.
Kod
function copyIntoClipboard(text) {
var flashId = 'flashId-HKxmj5';
/* Replace this with your clipboard.swf location */
var clipboardSWF = 'images/clipboard.swf';
if(!document.getElementById(flashId)) {
var div = document.createElement('div');
div.id = flashId;
document.body.appendChild(div);
}
document.getElementById(flashId).innerHTML = '';
var content = '<embed src="' +
clipboardSWF +
'" FlashVars="clipboard=' + encodeURIComponent(text) +
'" width="0" height="0" type="application/x-shockwave-flash"><\/embed>';
document.getElementById(flashId).innerHTML = content;
}
$(document).ready(function(){
$("#clipboard-copy").bind("click", function() {
copyIntoClipboard($("#aaaa").html());
$("#paste-area").val("");
});
$("#clipboard-copy-2-button").bind("click", function() {
copyIntoClipboard($("#clipboard-copy-2-source").html());
$("#paste-area").val("");
});
});
var flashId = 'flashId-HKxmj5';
/* Replace this with your clipboard.swf location */
var clipboardSWF = 'images/clipboard.swf';
if(!document.getElementById(flashId)) {
var div = document.createElement('div');
div.id = flashId;
document.body.appendChild(div);
}
document.getElementById(flashId).innerHTML = '';
var content = '<embed src="' +
clipboardSWF +
'" FlashVars="clipboard=' + encodeURIComponent(text) +
'" width="0" height="0" type="application/x-shockwave-flash"><\/embed>';
document.getElementById(flashId).innerHTML = content;
}
$(document).ready(function(){
$("#clipboard-copy").bind("click", function() {
copyIntoClipboard($("#aaaa").html());
$("#paste-area").val("");
});
$("#clipboard-copy-2-button").bind("click", function() {
copyIntoClipboard($("#clipboard-copy-2-source").html());
$("#paste-area").val("");
});
});
W tej czesci kodu $("#clipboard-copy").bind("click", function() {
jest cos takiego ze po kliknieciu kopiuje sie tresc, a czy mozna zrobic tak ze po zaladowaniu strony tresc automatycznie sie skopiuje bez klikania w przycisk?
Dziekuje i pozdrawiam.