Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 17:36:25
Original
1040 people have browsed it
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);

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template