1/** 2 * create url for GET 3 * @param oldUrl 4 * @param param 5 * @param value 6 * @returns 7 */ 8function replaceUrlParam(oldUrl,param,value){ 9 if(!_not_nullcheck_str(param)){ 10 return oldUrl; 11 } 12 var newUrl; 13 value = encodeURI(value); 14 ref1 = new RegExp("[?&]"+param+"\s*="); 15 if ( ref1.test(oldUrl)) { 16 ref = new RegExp("(?:([?&])"+param+"\s*=[^?&]*)"); 17 newUrl = oldUrl.replace(ref, "$1" + param + "=" + value); 18 } else if (/\?/.test(oldUrl)) { 19 newUrl = oldUrl + "&"+param+"=" + value; 20 } else { 21 newUrl = oldUrl + "?"+param+"=" + value; 22 } 23 return newUrl; 24} 25 26function removeUrlParam(oldUrl,param){ 27 ref = new RegExp("[?&]" + param + "=[^?&]*"); 28 newUrl = oldUrl.replace(ref, ""); 29 return newUrl; 30} 31 32/** 33 * null check 34 * @param str 35 * @returns 36 */ 37function _not_nullcheck_str(str){ 38 if(str != null && str != '' && str != undefined){ 39 return true; 40 }else{ 41 return false; 42 } 43}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.