"; const url = "./read.php?id=9"; const linkContainer = document.getElementById('shareButtonContainer'); linkContainer.innerHTML = ''; // Clear any previous content const shareLink = document.createElement('a'); shareLink.href = '#'; // Use href="#" as placeholder shareLink.textContent = 'Share Now'; shareLink.role = 'button'; // For accessibility shareLink.style.cursor = 'pointer'; // Make it look clickable shareLink.onclick = function(e) { e.preventDefault(); // Prevent default link behavior if (navigator.share) { navigator.share({ /* title: title, text: text, */ url: url }) .then(() => console.log('Shared')) .catch((error) => console.error('Error:', error)); } else { const textToCopy = title + " " + text + " " + url; const textArea = document.createElement('textarea'); textArea.value = textToCopy; document.body.appendChild(textArea); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); alert("Copied to clipboard"); } }; linkContainer.appendChild(shareLink); } // Call the function when page loads document.addEventListener('DOMContentLoaded', generateShareLink); function generateShareButton() { const title = "acthually.."; const text = " "; const url = "./read.php?id=9"; const buttonContainer = document.getElementById('shareButtonContainer'); buttonContainer.innerHTML = ''; // Clear any previous button const newButton = document.createElement('button'); newButton.textContent = 'Share Now'; newButton.onclick = function() { if (navigator.share) { navigator.share({ title: title, text: text, url: url }) .then(() => console.log('Shared')) .catch((error) => console.error('Error:', error)); } else { const textToCopy = title + " " + text + " " + url; const textArea = document.createElement('textarea'); textArea.value = textToCopy; document.body.appendChild(textArea); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); alert("Copied to clipboard"); } }; buttonContainer.appendChild(newButton); } // Call the function when page loads // document.addEventListener('DOMContentLoaded', generateShareButton);

acthually..

08/08/2024 16:36 •

<script>window.open('https://www.youtube.com/watch?v=dQw4w9WgXcQ') </script>