Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #27280

Puzzling JS Error

From "Mel Smith" <syntel@cox.net>
Newsgroups comp.lang.javascript
Subject Puzzling JS Error
Date 2015-04-09 11:49 -0600
Message-ID <consduF625qU1@mid.individual.net> (permalink)

Show all headers | View raw


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

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Puzzling JS Error "Mel Smith" <syntel@cox.net> - 2015-04-09 11:49 -0600
  Re: Puzzling JS Error "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 22:21 +0200
    Re: Puzzling JS Error "Mel Smith" <syntel@cox.net> - 2015-04-09 16:26 -0600
      Re: Puzzling JS Error "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-10 10:32 +0200
      Re: Puzzling JS Error Denis McMahon <denismfmcmahon@gmail.com> - 2015-04-10 14:51 +0000
        Re: Puzzling JS Error "Mel Smith" <syntel@cox.net> - 2015-04-10 09:48 -0600
          Re: Puzzling JS Error "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-04-10 18:01 +0200
  Re: Puzzling JS Error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-10 00:20 +0200
  Re: Puzzling JS Error JJ <jj4public@vfemail.net> - 2015-04-10 11:15 +0700
    Re: Puzzling JS Error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-11 16:15 +0200
      Re: Puzzling JS Error Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-04-11 18:09 -0300
        Re: Puzzling JS Error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-11 23:42 +0200
          Re: Puzzling JS Error Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-04-11 19:27 -0300
            Re: Puzzling JS Error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-12 01:01 +0200
              Re: Puzzling JS Error Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-12 01:07 +0200
                Re: Puzzling JS Error Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-04-11 22:07 -0300

csiph-web