Reference Rules and IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brett Foster

    #1

    Reference Rules and IE

    Ok this is driving me freekin nuts. I have a fairly simple class that
    wraps mozilla XMLHttpRequest and Microsoft.XMLHT TP into a simple class.
    It has worked but I've been caught by some sort of gotcha:

    {
    ....
    this.document = __global = new ActiveXObject(" Microsoft.XMLHT TP");
    ....
    }

    when I press a button alert( that.document ) shows a dialog with an
    empty string (i.e. not undefined, or null) and __global shows up as an
    object. In Mozilla the expected behaviour is shown.

    So what are the god damn rules for avoiding what ever the hell this
    problem is?

    Brett
  • Martin Honnen

    #2
    Re: Reference Rules and IE



    Brett Foster wrote:
    [color=blue]
    > I have a fairly simple class that
    > wraps mozilla XMLHttpRequest and Microsoft.XMLHT TP into a simple class.
    > It has worked but I've been caught by some sort of gotcha:
    >
    > {
    > ...
    > this.document = __global = new ActiveXObject(" Microsoft.XMLHT TP");
    > ...
    > }
    >
    > when I press a button alert( that.document ) shows a dialog with an
    > empty string (i.e. not undefined, or null) and __global shows up as an
    > object. In Mozilla the expected behaviour is shown.[/color]

    The above line would yield an error in Mozilla. Make a minimal example
    demonstrating the problem and post the full code or a URL to it.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • Brett Foster

      #3
      Re: Reference Rules and IE

      Martin Honnen wrote:[color=blue]
      >
      >
      > Brett Foster wrote:
      >[color=green]
      >> I have a fairly simple class that wraps mozilla XMLHttpRequest and
      >> Microsoft.XMLHT TP into a simple class. It has worked but I've been
      >> caught by some sort of gotcha:
      >>
      >> {
      >> ...
      >> this.document = __global = new ActiveXObject(" Microsoft.XMLHT TP");
      >> ...
      >> }
      >>
      >> when I press a button alert( that.document ) shows a dialog with an
      >> empty string (i.e. not undefined, or null) and __global shows up as an
      >> object. In Mozilla the expected behaviour is shown.[/color]
      >
      >
      > The above line would yield an error in Mozilla. Make a minimal example
      > demonstrating the problem and post the full code or a URL to it.
      >[/color]

      Thanks, but the problem was that I was concatenating an object in to a
      string and IE made it ''... It worked fine when by itself in the alert.
      This was compounded by an insane webserver that was serving up strange
      responses. Switched to apache2, and all was nice.

      Thanks

      Brett

      Comment

      Working...