Skip to content

Instantly share code, notes, and snippets.

View abid112's full-sized avatar
🎯
Focusing

Abid Hasan abid112

🎯
Focusing
View GitHub Profile
@abid112
abid112 / change-url-based-on-url-parameter.js
Last active July 21, 2022 08:48
Change URL based on URL Parameter using jQuery
//Trim and get the value of URL parameter from URL
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');