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

ActiveX Objects and stringify errors

Expand Messages
  • ingliss
    I don t expect this to apply to many people, and I m not remarking on it as a shortcoming of JSON (because it clearly isn t), this is just for information:
    Message 1 of 1 , Jan 3, 2006
    • 0 Attachment
      I don't expect this to apply to many people, and I'm not remarking on
      it as a shortcoming of JSON (because it clearly isn't), this is just
      for information:

      Javascript under IE allows methods and properties of ActiveX Objects
      to be assigned to Javascript properties.

      In some circumstances this seems to cause problems; specifically when
      stringify is called, the browser throws a generic 0x8000ffff "oh dear
      somethings gone horribly wrong" error. The error is thrown when
      calling hasOwnProperty for an ActiveX reference.

      To circumvent the error I:

      1) Change the variable declaration in g() to read:

      var c, i, l, v, own;

      2) Replace the problematic clause with:

      try {
      own = x.hasOwnProperty(i) ;
      }
      catch (eHasOwnProperty) {
      own = true ;
      }
      if (own &&
      typeof v != 'undefined' &&
      typeof v != 'function') {
      if (l < a.length) {
      e(',');
      }
      g(i);
      e(':');
      g(v);
      }



      As I say, just for information.
    Your message has been successfully submitted and would be delivered to recipients shortly.