/*================================= 链接类 JPageUrl{===================================*/
function JPageUrl(url) {
this.url = url.toLower();
}
JPageUrl.prototype.add = function(name, value){
if(this.url.isNullOrEmpty() == true)
return "";
if(!name.isNullOrEmpty()) {
var pi = this.url.indexOf(name);
if(pi != -1) {
var tempstring = this.url.substr(pi, this.url.length - pi);
var pj = tempstring.indexOf("&");
if(pj == -1)
{
this.url = this.url.replace(tempstring, name + "=" + this.encode(value));
}
else
{
var tempstr0 = tempstring.substr(0, pj);
this.url = this.url.replace(tempstr0, name + "=" + this.encode(value));
}
}
else{
if (this.url.indexOf("?") != -1)
this.url += "&" + name + "=" + this.encode(value);
else
this.url += "?" + name + "=" + this.encode(value);
}
}
}
JPageUrl.prototype.encode = function(value) {
return encodeURIComponent(value);
}
/*================================= }链接类 JPageUrl ===================================*/
function JPageUrl(url) {
this.url = url.toLower();
}
JPageUrl.prototype.add = function(name, value){
if(this.url.isNullOrEmpty() == true)
return "";
if(!name.isNullOrEmpty()) {
var pi = this.url.indexOf(name);
if(pi != -1) {
var tempstring = this.url.substr(pi, this.url.length - pi);
var pj = tempstring.indexOf("&");
if(pj == -1)
{
this.url = this.url.replace(tempstring, name + "=" + this.encode(value));
}
else
{
var tempstr0 = tempstring.substr(0, pj);
this.url = this.url.replace(tempstr0, name + "=" + this.encode(value));
}
}
else{
if (this.url.indexOf("?") != -1)
this.url += "&" + name + "=" + this.encode(value);
else
this.url += "?" + name + "=" + this.encode(value);
}
}
}
JPageUrl.prototype.encode = function(value) {
return encodeURIComponent(value);
}
/*================================= }链接类 JPageUrl ===================================*/