Home  >  Article  >  Web Front-end  >  A small example of jQuery getting the GET parameter value of the URL_jquery

A small example of jQuery getting the GET parameter value of the URL_jquery

WBOY
WBOYOriginal
2016-05-16 17:36:251036browse
Copy code The code is as follows:

// * jQuery url get parameters function [Get the GET parameter value of the URL ]
// *character_set UTF-8
// * author Jerry.li(lijian@dzs.mobi)
// * version 1.2012.12.11.1400
// * Example
// *  
// *   var GET = $.urlGet(); //Get the Get parameters of the URL
// *   var id = GET['id']; //Get the id Value
// *                                                                                          > // Public
// Return array ()
//
Urlget: function ()
{
var aquery = window.location.href.split ("?");/ /Get Get parameters
var aGET = new Array();
if(aQuery.length > 1)
var aBuf = aQuery[1].split("&"); for (var I = 0, Iloop = Abuf.length; I & lt; Iloop; i)
{
var aTMP = abuf [i] .split ("="); // separate key and value
          aGET[aTmp[0]] = aTmp[1];
                                                      🎜> });
})(jQuery);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn