Cloning objects
function cloneobj (obj) { var newObj = {} for (varin obj) { = Obj[prop] } return newObj;}
//Redo
function Trim (arr) { Span style= "COLOR: #0000ff" >var res = []; var json = {}; for (var i = 0; i < arr.length; i++< Span style= "color: #000000") { if (! Json[arr[i]] {res.push (arr[i]); Json[arr[i]] = 1; }} return res;}
Gets the target object of the current point
function(point) { var res = document.elementfrompoint (point.x, point.y) return Res;}
//URL ParametersfunctionRequest (m) {varsvalue = Location.search.match (NewRegExp ("[\?\&]" + M + "= ([^\&]*) (\&?)", "I")); returnSvalue? Svalue[1]: svalue;}functionurlupdateparams (URL, name, value) {varR =URL;if(r! =NULL&& r! = ' undefined ' && r! = "") {Value=encodeURIComponent (value); varReg =NewRegExp ("(^|)" + name + "= ([^&]*) (|$)"); varTMP = name + "=" +value; if(Url.match (reg)! =NULL) {R=Url.replace (eval (reg), TMP); } Else{if(Url.match ("[\?]") ) {R= URL + "&" +tmp; } Else{R= URL + "?" +tmp; }}}returnR;}
Some common methods in JavaScript