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

hook function doesn't work in Opera 8.x

Expand Messages
  • Peter Michaux
    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
    Message 1 of 2 , Jan 24, 2007
    • 0 Attachment
      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
    • 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 2 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.