URLQueryString for JQuery


JavaScript • JQuery


function checkTabsToActivate(){
	var urlParams = new URLSearchParams(window.location.search);
	var tabID = urlParams.get("tab");
	if (tabID){ 
		/* variable */
		$('#'+tabID+'-tab').tab('show'); 
	} else {
		/* hashtag */
		var hash = window.location.hash;
		$(hash + '-tab').tab('show');
	}
}

Written by fbrefere001

Posted by fbrefere001 on Wednesday February 21, 2018