ბმულის კოპირება საიტის ლინკის გარეშე:<script>
Nsm = 10;
pat = 'https://smiles.do.am/smiles/Text1/';
for (i = 1; i <= Nsm; i++) {
const imgUrl = pat + i + '.png';
document.write('<a href="javascript://" onClick="copyToClipboard(\'' + imgUrl + '\'); return false;"><img border="0" src="' + imgUrl + '"></a> ');
}
function copyToClipboard(text) {
navigator.clipboard.writeText(text).then(function() {
console.log('ბმული დაკოპირებულია: ' + text);
alert('ბმული კოპირებულია ბუფერში!');
}).catch(function(err) {
console.error('შეცდომა: ', err);
});
}
</script>
<script>
const Nsm = 10;
const basePath = 'https://smiles.do.am'; // ძირითადი URL
const relativePath = '/smiles/Text1/'; // შედარებითი ბილიკი
for (let i = 1; i <= Nsm; i++) {
const fullImgUrl = basePath + relativePath + i + '.png';
const partialUrl = relativePath + i + '.png'; // მხოლოდ ნაწილი
document.write(
`<a href="javascript:void(0);" onclick="copyToClipboard('${partialUrl}'); return false;">
<img border="0" src="${fullImgUrl}">
</a> `
);
}
function copyToClipboard(text) {
navigator.clipboard.writeText(text).then(() => {
console.log('დაკოპირდა: ' + text);
alert('ბმული კოპირებულია ბუფერში: ' + text);
}).catch(err => {
console.error('შეცდომა კოპირებისას:', err);
});
}
</script>