regex

Alternative for URLSearchParams

IE doesn’t support “URLSearchParams”. So sometimes your script will not work in IEs. So the alternative for the “URLSearchParams” is as below. window.getUrlParameter = function( keyword, query_string ) { keyword = keyword.replace(/[\[]/, ‘\\[‘).replace(/[\]]/, ‘\\]’); var regex = new RegExp( keyword + ‘=([^&#]*)’); var results = regex.exec( query_string ); return results === null ? ” : …

Alternative for URLSearchParams Read More »