Copy Code code as follows:
var parambeanlist = new Array ();
Array.prototype.addparambean=function (parambeanobj) {
var index = This.containparambean (parambeanobj);
if (index!=-1) {
This[index] = parambeanobj;
} else {
This.push (Parambeanobj);
}
};
Array.prototype.clear=function () {
if (This.length = = 0) {
Return
}
For (var index in this) {
This.pop ();
}
};
Array.prototype.containparambean=function (parambeanobj) {
var index =-1;
if (This.length = = 0) {
return index;
}
for (var tempindex = 0, step = this.length; Tempindex < step; tempindex++) {
if (This[tempindex].compare (parambeanobj) = = 0) {
index = Tempindex;
Break
}
}
return index;
};
var Parambean = new Function (Pkcode, opdate, value) {
This.pkcode = Pkcode;
This.opdate = opdate;
This.value = value;
};
parambean.prototype={
Tostring:function () {
Return "[Pkcode:" + This.pkcode + ", opdate:" + this.opdate + ", Value:" + This.value + "]";
},
Doverify:function () {
Return (This.pkcode this.opdate this.value?) ' True ': ' false ': ' False ': ' false ';
},
Compare:function (otherobj) {
var result =-1;
if (otherobj) {
if (This.pkcode = = Otherobj.pkcode && This.opdate = = Otherobj.opdate
&& This.value = = Otherobj.value) {
result = 0;
}
}
return result;
}
};
var paramutils = new Object ();
Paramutils.docreateajaxstr=function () {
var paramstr = "";
if (Parambeanlist.length = = 0) {
return paramstr;
}
var keyparamarray = new Array ();
var valueparamarray = new Array ();
for (var index = 0, step = parambeanlist.length Index < step; index++) {
var tempobj = Parambeanlist[index];
Keyparamarray.push (Tempobj.pkcode + "'" + tempobj.opdate);
Valueparamarray.push (Tempobj.value);
}
Paramstr = "key_param=". Concat (encodeURIComponent (Keyparamarray.join (",")). Concat ("&"). Concat ("value_param= ". Concat (encodeURIComponent (Valueparamarray.join (", ")));
return paramstr;
};
This article I wrote for a while, to the csdn on a half-day to get up, I use IE6 cut to the senior editor, the content is directly empty, and finally with Firefox browser unexpectedly brought up again.