473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Reference Rules and IE

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

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

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
Jul 23 '05 #1
2 1056


Brett Foster wrote:
I have a fairly simple class that
wraps mozilla XMLHttpRequest and Microsoft.XMLHTTP into a simple class.
It has worked but I've been caught by some sort of gotcha:

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

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.


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/
Jul 23 '05 #2
Martin Honnen wrote:


Brett Foster wrote:
I have a fairly simple class that wraps mozilla XMLHttpRequest and
Microsoft.XMLHTTP into a simple class. It has worked but I've been
caught by some sort of gotcha:

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

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.

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.


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
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ryan Hubbard | last post by:
Could someone provide me with some code to hold an object reference in a static variable in a function. function a(&$t){ static $b; if(is_object($b)){ print "IN - $b->logfile"; } else {...
3
by: vikenk | last post by:
Hello, This is my first post to this group. A little background first: I'm not not new to web-design, but new to manual coding :>) I'm trying to move from total dependence on FrontPage to more...
11
by: Frederick Gotham | last post by:
We all know that there's special rules for the binding of a "reference to const" to an R-value, i.e.: int const &i = 5; acts as if it were: int const __rval = 5; int const &i = __rval;
7
by: Johannes Bauer | last post by:
Hello Group, please consider the following code #include <vector> #include <iostream> #define USE_CONST #define USE_STRING
68
by: Jim Langston | last post by:
I remember there was a thread a while back that was talking about using the return value of a function as a reference where I had thought the reference would become invalidated because it was a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.