top of page

Forum Comments

GetClipboardData?
In Velo (Wix Code)
Eitan Waxman
Jan 12, 2025
Hi Soccer Coach, Velo doesn't have an API but you can achieve this functionality using a custom element. For example: class ClipboardReader extends HTMLElement { constructor() { super(); // Create a shadow DOM this.attachShadow({ mode: 'open' }); // HTML structure for the custom element this.shadowRoot.innerHTML = ` Read Clipboard Clipboard content will appear here. `; // Reference button and output elements this.button = this.shadowRoot.querySelector('#read-clipboard'); this.output = this.shadowRoot.querySelector('#output'); // Bind the event listener this.handleButtonClick = this.handleButtonClick.bind(this); } connectedCallback() { // Attach the event listener when the element is added to the DOM this.button.addEventListener('click', this.handleButtonClick); } disconnectedCallback() { // Clean up the event listener when the element is removed from the DOM this.button.removeEventListener('click', this.handleButtonClick); } async handleButtonClick() { try { // Use the Clipboard API to read text const text = await navigator.clipboard.readText(); this.output.textContent = `Clipboard Content: ${text}`; } catch (err) { this.output.textContent = 'Failed to read clipboard content. Please ensure you allow clipboard access.'; console.error('Error:', err); } } } // Define the custom element customElements.define('clipboard-reader', ClipboardReader); Please note that the user will need to give clipboard read permission to the site for this to work. You can learn more about custom element implementation in Wix here: How to use Custom Elements in Wix (and when) Best, Eitan
Content media
0
0
Connect a Custom Catalog to Wix Stores
In Velo (Wix Code)
Eitan Waxman
Jan 12, 2025
See above
Content media
0
Connect a Custom Catalog to Wix Stores
In Velo (Wix Code)
Eitan Waxman
Jan 12, 2025
test
0
Unauthorized: Pdf generator api
In Velo (Wix Code)
Son Aktivite Öğe seçeneği menüsü Wix Post'a özel bir Blok eklenebilir mi?
In Wix Studio
Error when setting up google sheets integration
In Velo (Wix Code)

Eitan Waxman

Admin
More actions
bottom of page