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

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

Expand Messages
  • Stephen M. McKamey
    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
    Message 1 of 2 , 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,
      smm

      --- 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
      me
      > because I am not augmenting any of JavaScripts built-in prototypes.
      >
      > Peter
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.