Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Mel Smith" Newsgroups: comp.lang.javascript Subject: Puzzling JS Error Date: Thu, 9 Apr 2015 11:49:46 -0600 Lines: 48 Message-ID: X-Trace: individual.net UOSFBmL7CWjgD82xlmet2gkU4+gUzSOliZyQEZtTNPiQS1BilD Cancel-Lock: sha1:j2CJJmHExi+DjUQVNTJmuX5EHK0= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Xref: csiph.com comp.lang.javascript:27280 Hi: I've been buzzing around an Ajax set up for a couple of weeks now, and have done this successfully quite a few times over the past few years I have serially used a older and successful Ajax set up function for several year (a fe years ago) and am now using a slight variation of it. I show a small fragment of the set up code which I have finally determined is buggy -- but only in this newest case) Within my Ajax set up ES/JS code I have the following few lines ****** fragment of Ajax set up code ******** var HTTP; /* // problem in this next statement if (HTTP && (typeof HTTP !== "object" || HTTP.NAME)) { throw new Error("Namespace 'HTTP' already exists"); } */ alert("Ready toComplete Ajax set up.") ; ********************************* If I REMOVE the /* ... */ remark indicators above, my Ajax set up function Fails ! and I get no farther in this code. A following Alert() is never executed, and my Ajax is not operative. My later HTTP.post() function fails as it says that HTTP is undefined If I comment out the statement (as shown above), my Ajax request works perfectly, and my HTTP.post() functions sends my request and I get a quick 0.5 second response ! I cannot see where my error is, and JSLint didn't help me. Also, my other Ajax setups using this code in another app still lwork perfectly using the code above. Question: What is there in the statement above that is incorrect and now causing ES/JS to fail ?? Thanks for hints / suggestions -Mel Smith