Skip to content

Commit

Permalink
Refactor getUrlParameter in SignItVideosIframe.html
Browse files Browse the repository at this point in the history
  • Loading branch information
hugolpz authored Aug 5, 2024
1 parent 6b5b48e commit f2c27f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions SignItVideosIframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@

document.addEventListener('DOMContentLoaded', function() {
// Function to get URL parameters
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
function getUrlParameter(name) {
const urlParams = new URLSearchParams(window.location.search);
return decodeURIComponent(urlParams.get(name)) || '';
}

// Get the video URL from the URL parameter
Expand Down

0 comments on commit f2c27f1

Please sign in to comment.