Loading ...
Sorry, an error occurred while loading the content.

706Re: hook function doesn't work in Opera 8.x

Expand Messages
  • Stephen M. McKamey
    Jan 30, 2007
    • 0 Attachment
      It might be that Opera 8.x doesn't support that method (I don't have
      it on this machine to check). You can add
      an equivalent method by putting this before the JSON script:

      if ("undefined"===typeof Object.prototype.hasOwnProperty) {
      Object.prototype.hasOwnProperty=function(p) {
      return ("undefined"!==typeof this[p]) &&
      ("undefined"===typeof this.constructor.prototype[p]);

      Hope that helps,

      --- In json@yahoogroups.com, "Peter Michaux" <petermichaux@...> wrote:
      > Hi,
      > To get the hook function to descend into deeper parts of the JSON
      > structure in Opera 8.x I had to remove the following from the hook
      > funciton
      > if (v.hasOwnProperty(i)) {
      > and the associated closing brace.
      > I have a namespaced version of json.js and this removal is fine for
      > because I am not augmenting any of JavaScripts built-in prototypes.
      > Peter
    • Show all 2 messages in this topic