Get URL Parameter By Name

Javascript function to get query string parameters by the name. function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");

 function getParameterByName(name) {
     name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
     var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
         results = regex.exec(location.search);
     return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
 }

Javascript function to get query string parameter value by name.

Usage:

var val=getParameterByName('query');
List Mag WP Menu
Join our feeds to automatically receive the latest headlines, news, and information formatted for your club's website or news reader.