Mel Smith
4/10/2015 3:48:00 PM
Denis said:
>
> First I would suggest looking at all the differences between your old
> working code and your new not working code.
I've looked on and off for several weeks before coming here with this
'puzzler'
>
> Secondly, are you loading any other scripts such as external advertising
> scripts, google statistics, some other analytics, or anything else from
> external sources in the page that fails that might be causing a naming
> conflict with your global "HTTP" variable?
Only my own scripts that I use for urilities. No 'outside' scripts. No
other mention of the var 'HTTP'
>
> Describing your error in terms of "the code I'm not showing you doesn't
> work but the code I'm showing you does work and making this little change
> to the code I'm showing you makes it work or not work" really isn't very
> helpful to us in trying to diagnose the issue.
To try to be more helpful:
1. I use the alert(...) function as my main (usually only) debugging
tool.
2. In this current instance, I placed an alert() ahead of my suspect
statement, and an alert() immediately after the statement
3. When the statement is 'active', the 1st alert() is displayed, but
the 2nd alert() is not shown.
4. Which leads me to believe that:
a. the statement is syntactically incorrect, or
b. An exception is 'thrown'.
5. I don't even know what 'throw' does or where it displays, or where
it can be seen
6. If it *is* 'thrown', maybe that's why I don't get to the seconf
alert() but still keep running and showing my page correctly
I guess its obvious that I copied this code years ago (maybe
incorrectly). Its from Flanagan's 'The Definitive Guide' 5th edition.
I've been using it of and on for four years now without really
understanding what was happening. But now I'm getting a better idea.
> When you said
>
>> If I REMOVE the /* ... */ remark indicators above, my Ajax set up
>> function Fails ! and I get no farther in this code.
>
> did you mean that it threw the error "Namespace 'HTTP' already exists",
> that you received some other error indication in the console, or what?
>
> I understand:
>
>> A following Alert() is never executed
>
> but I'm not sure whether that's because (a) the code has thrown it's
> error as instructed, in which case you need to investigate why HTTP is
> defined and is either an object or has a name attribute; or (b) because
> of some syntax error (which might be being caused by, for example, a non
> visible encoded character in the source code file that is breaking the
> javascript parser.
for a above . If it is 'thrown' then where is it thrown too ?
for b above. I'll retype it completely and try again later today.
>
> So: Does it throw the "Namespace 'HTTP' already exists" exception? If
> not, what does the error console show (a) when the page is loaded and (b)
> when the code is executed.
Sorry, using (mostly) IE11 , and visiting my own web site for this
page, I don't know how to activate the 'error console'. I just plug along
with Alert() functions until I narrow my bug down to some statement I can
fix. Where does this thrown error display ?
btw, because of other complexities, my CGI server (a C-based exe), gets
the request for my first/only page in this app, then looks at the IP
address. If it is my own personal IP, then I send the test page with my
error in it. Otherwise, my regular users, get the older working non-HTTP
page. When I've got this problem worked out (or ignored as above), I'll
introduce my new page to the users.
Thanks for the response.
I just got my 1st smartphone from London, England yesterday (a Moto G
(2nd Gen) (4G LTE ) unlocked with no SIM - $369 Cdn bucks+ shipping $29,97+
$28.61 Duty/taxes), and I'm excited about going out to a kiosk and getting a
SIM and getting to use the phone. New things to learn :)
In the meantime, I'm going to leave the problem statement *commented
out*, and carry on with the app development until some greater insight jumps
at me.
When I surface again in a few days, I'll be back.
Thanks again.
-Mel Smith