1 jQuery.extend({
2 /**
3 * Returns get parameters.
4 *
5 * If the desired param does not exist, null will be returned
6 *
7 * @example value = $.getURLParam("paramName");
8 */
9 getURLParam: function(strParamName)
10 {
11 var strReturn = "";
12 var strHref = window.location.href.toUpperCase();
13
14 var bFound = false;
15
16 var cmpstring = strParamName.toUpperCase() + "=";
17 var cmplen = cmpstring.length;
18
19 if (strHref.indexOf("?") > -1)
20 {
21 var strQueryString = strHref.substr(strHref.indexOf("?") + 1);
22 var aQueryString = strQueryString.split("&");
23 for (var iParam = 0; iParam < aQueryString.length; iParam++)
24 {
25 if (aQueryString[iParam].substr(0, cmplen) == cmpstring)
26 {
27 var aParam = aQueryString[iParam].split("=");
28 strReturn = aParam[1];
29 bFound = true;
30 break;
31 }
32
33 }
34 }
35 if (bFound == false) return null;
36 return strReturn;
37 },
38 getStringParam: function(strParamName, strParamString)
39 {
40 var strReturn = "";
41 var strHref = strParamString.toUpperCase();
42 var bFound = false;
43
44 var cmpstring = strParamName.toUpperCase() + "=";
45 var cmplen = cmpstring.length;
46
47 var strQueryString = strHref;
48 var aQueryString = strQueryString.split("&");
49 for (var iParam = 0; iParam < aQueryString.length; iParam++)
50 {
51 if (aQueryString[iParam].substr(0, cmplen) == cmpstring)
52 {
53 var aParam = aQueryString[iParam].split("=");
54 strReturn = aParam[1];
55 bFound = true;
56 break;
57 }
58
59 }
60
61 if (bFound == false) return null;
62 return strReturn;
63 }
64 });
2 /**
3 * Returns get parameters.
4 *
5 * If the desired param does not exist, null will be returned
6 *
7 * @example value = $.getURLParam("paramName");
8 */
9 getURLParam: function(strParamName)
10 {
11 var strReturn = "";
12 var strHref = window.location.href.toUpperCase();
13
14 var bFound = false;
15
16 var cmpstring = strParamName.toUpperCase() + "=";
17 var cmplen = cmpstring.length;
18
19 if (strHref.indexOf("?") > -1)
20 {
21 var strQueryString = strHref.substr(strHref.indexOf("?") + 1);
22 var aQueryString = strQueryString.split("&");
23 for (var iParam = 0; iParam < aQueryString.length; iParam++)
24 {
25 if (aQueryString[iParam].substr(0, cmplen) == cmpstring)
26 {
27 var aParam = aQueryString[iParam].split("=");
28 strReturn = aParam[1];
29 bFound = true;
30 break;
31 }
32
33 }
34 }
35 if (bFound == false) return null;
36 return strReturn;
37 },
38 getStringParam: function(strParamName, strParamString)
39 {
40 var strReturn = "";
41 var strHref = strParamString.toUpperCase();
42 var bFound = false;
43
44 var cmpstring = strParamName.toUpperCase() + "=";
45 var cmplen = cmpstring.length;
46
47 var strQueryString = strHref;
48 var aQueryString = strQueryString.split("&");
49 for (var iParam = 0; iParam < aQueryString.length; iParam++)
50 {
51 if (aQueryString[iParam].substr(0, cmplen) == cmpstring)
52 {
53 var aParam = aQueryString[iParam].split("=");
54 strReturn = aParam[1];
55 bFound = true;
56 break;
57 }
58
59 }
60
61 if (bFound == false) return null;
62 return strReturn;
63 }
64 });