Hi, > The details of the conflict are beyond my understanding of JS/ > Prototype, but I gather it has to do with both scripts trying to > modify Object.prototype.
Prototype does _not_ modify the Object prototype. Doing so is a good way to break all sorts of things. Prototype modifies the Object instance itself (*not* its prototype) and it modifies the prototypes of Array, String, and some others, but not Object. > I am wondering, however, if json-min.js is being a bad citizen, or... If it's modifying Object.prototype, probably yes. And unfortunately, it looks like it is: > Object.prototype.toJSONString=function(){... It also looks to me like the copy you referenced above has a pretty serious syntax error in it which makes me wonder how it works at all: > for(i=0;i<10?"0"+n:n; } The compiler/interpreter will be expecting a parenthesis or incrementer where that curly brace is. FWIW, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jul 12, 2:22 pm, Brian <thisismamm...@gmail.com> wrote: > I'm using ProtoFish (and therefore Prototype) on a client project, and > some parts of the project are hosted by a third-party web app that > includes some JavaScript of their own. > > I've determined that one of the scripts (http://mcle.custhelp.com/cgi- > bin/mcle.cfg/php/euf/application/development/source/rightnow/ > javascript/json-min.js) is conflicting with Prototype, breaking the > drop down menus, and returning "Error: INVALID_CHARACTER_ERR: DOM > Exception 5 / prototype.js:1817" in the Safari console. > > The details of the conflict are beyond my understanding of JS/ > Prototype, but I gather it has to do with both scripts trying to > modify Object.prototype. I understand that extending JavaScript Array > and Object types is controversial, and I'm not trying to re-raise that > issue. > > I am wondering, however, if json-min.js is being a bad citizen, or > simply doing the same type of thing that Prototype does, and therefore > conflicting. And more importantly, is there anything I can do, since > getting the third-party to modify their system is unlikely, to route > around the collision? > > Thanks, > > Brian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---