Here is a function that you can use to get the get-values from URLs and can use it to manipulate web pages on document load.
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('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
};
$(document).ready(function(){
var tab = getUrlParameter('tab'); // Assigning value to local variale
if( tab == 'settings' ){
$('#custom-tabs__settings').click();
}
});
You must be logged in to post a comment.