Return to Snippet

Revision: 8489
at September 25, 2008 11:22 by Bonky


Initial Code
function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

Initial URL
http://www.netlobo.com/url_query_string_javascript.html

Initial Description

                                

Initial Title
Get URL Parameters

Initial Tags
regex, url

Initial Language
JavaScript