javascript - Uncaught TypeError: Object has no method 'exec' -


i'm using code below , it's working good, when try use jquery @ same time, i'm getting below error, reading posts , think problem no possible extend object.prototype without checking hasownproperty(), don't know how solve that, can give me hand?

code:

object.prototype.clone = function () {     var i, newobj = (this instanceof array) ? [] : {};     (i in this) {         if (i === 'clone') {             continue;         }         if (this[i] && typeof this[i] === "object") {             newobj[i] = this[i].clone();         } else {             newobj[i] = this[i];         }     }     return newobj;     }; 

error:

uncaught typeerror: object function () {     var i, newobj = (this instanceof array) ? [] : {};     (i in this) {         if (i === 'clone') {             continue;         }         if (this[i] && typeof this[i] === "object") {             newobj[i] = this[i].clone();         } else {             newobj[i] = this[i];         }     }     return newobj; } has no method 'exec'  

add following function clone object:

object.prototype.clone.exec=function() {     //your codes }; 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -