Skip to content

Commit

Permalink
Update _worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
xixu-me authored Aug 29, 2024
1 parent 6b30835 commit 1f8b3ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2124,14 +2124,14 @@ var HTML_HOMEPAGE = `
<body>
<h1>QR Generator</h1>
<form id="qrForm">
<label for="textInput">Enter text:</label>
<input type="text" id="textInput" name="text" required>
<label for="urlInput">Enter text:</label>
<input type="text" id="urlInput" name="url" required>
<button type="submit">Generate QR code!</button>
</form>
<script>
document.getElementById('qrForm').addEventListener('submit', function (event) {
event.preventDefault();
let text = document.getElementById('textInput').value;
let url = document.getElementById('urlInput').value;
window.open(\`/?text=\${encodeURIComponent(url)}\`, '_blank');
});
</script>
Expand Down

0 comments on commit 1f8b3ec

Please sign in to comment.