|
|||
|
Dear JavaScripters:
Laugh or cry depending on which side of the fence you are on. I had a problem with an XMLHttpRequest object not working right. readyState did not exist. Oh? Remember that I am still learning this and am adapting code so there was the very real possibility that I had overlooked something about setting up the object. It turned that that I had overlooked something, just not something specific to the object. I put in some checking to see the object variable's value and nullness. Well, it did get assigned properly. Had I declared it properly? Oh, yes. OK, now what about where it is used? What? It is undefined? Unfortunately, I had also declared it improperly. It was supposed to be a global and was declared as such. Unfortunately, I was following someone else's code so I did not notice that I had also declared it locally in the function that set up the object. Happy Canada Day (July 1), Independence Day (July 4), some other excuse for a good time (about now). Sincerely, Gene Wirchenko |
|
|
||||
|
||||
|
|
|
|||
|
In article <6d04v7hag5nipt5n8696rsp77d5bu0diop@4ax.com>,
Gene Wirchenko <genew@ocis.net> wrote: > I had a problem with an XMLHttpRequest object not working right. > readyState did not exist. Oh? Remember that I am still learning this > and am adapting code so there was the very real possibility that I had > overlooked something about setting up the object. It turned that that > I had overlooked something, just not something specific to the object. > > I put in some checking to see the object variable's value and > nullness. Well, it did get assigned properly. Had I declared it > properly? Oh, yes. > > OK, now what about where it is used? What? It is undefined? > Unfortunately, I had also declared it improperly. > > It was supposed to be a global and was declared as such. > Unfortunately, I was following someone else's code so I did not notice > that I had also declared it locally in the function that set up the > object. I take it that you only need one of these at once, then. -- Tim "That excessive bail ought not to be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted" -- Bill of Rights 1689 |
|
|||
|
On Mon, 02 Jul 2012 22:52:47 +0100, Tim Streater
<timstreater@greenbee.net> wrote: [snip] >I take it that you only need one of these at once, then. Yes, the global. It is the sort of mistake that I would not make on my own, but when I do not fully understand the code that I am adapting -- part of why I am adapting it -- errors can occur. Sincerely, Gene Wirchenko |
|
|||
|
On Tue, 03 Jul 2012 13:39:49 +0100, Tim Streater
<timstreater@greenbee.net> wrote: >In article <6174v758q932srbnus4ghml7kssgkhpk6v@4ax.com>, > Gene Wirchenko <genew@ocis.net> wrote: > >> On Mon, 02 Jul 2012 22:52:47 +0100, Tim Streater >> <timstreater@greenbee.net> wrote: >> >> [snip] >> >> >I take it that you only need one of these at once, then. >> >> Yes, the global. It is the sort of mistake that I would not make >> on my own, but when I do not fully understand the code that I am >> adapting -- part of why I am adapting it -- errors can occur. > >OK. In my case I could have more than one httprequest running at once, >so I left it as a variable local to my encapsulation function, thus: I may change it. I am still experimenting. [snip] Sincerely, Gene Wirchenko |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|