Google Groups Home
Help | Sign in
Siple AJAX, of course
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Monica Leko  
View profile
 More options May 9, 1:48 pm
Newsgroups: comp.lang.javascript
From: Monica Leko <monica.l...@gmail.com>
Date: Fri, 9 May 2008 10:48:34 -0700 (PDT)
Local: Fri, May 9 2008 1:48 pm
Subject: Siple AJAX, of course
Doesn't work.  :)

I am using Google maps example from book, and from Google
documentation.  It is really simple, and I don't know why isn't
working.  My browser send mi this response:

This XML file does not appear to have any style information associated
with it. The document tree is shown below.
<markers id="id je ok">
<marker found="Keychain" lat="37.441" left="Book" lng="-122.141"/>
<marker found="Water Bottle" lat="37.322" left="Necklace"
lng="-121.213"/>
</markers>

My code is following
var getVars =  "?q=" + search;
var request = GXmlHttp.create();
request.open('GET', '/lbs/' + getVars, true);
request.onreadystatechange = function() {
  if (request.readyState == 4) {
    var xmlDoc = request.responseXML;
    alert(xmlDoc);
    var responseNode = xmlDoc.getElementsByTagName('markers').item(0);
    var type = responseNode.getAttribute("id");
  }

}

responseXML allways sends back null value, although server sends back
XML.  And, what I don't understanf (still newbie), after the alert
popups and write "null", my browser render upper XML file, instead
doing nothing and show page from which I called AJAX function.  How
can this be?

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Cole  
View profile
 More options May 9, 2:57 pm
Newsgroups: comp.lang.javascript
From: Tom Cole <tco...@gmail.com>
Date: Fri, 9 May 2008 11:57:52 -0700 (PDT)
Local: Fri, May 9 2008 2:57 pm
Subject: Re: Siple AJAX, of course
On May 9, 1:48 pm, Monica Leko <monica.l...@gmail.com> wrote:

Does your server indeed return a valid XML document with content-type
of "text/xml" and what does the entire XML document look like?

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Monica Leko  
View profile
 More options May 9, 3:34 pm
Newsgroups: comp.lang.javascript
From: Monica Leko <monica.l...@gmail.com>
Date: Fri, 9 May 2008 12:34:22 -0700 (PDT)
Local: Fri, May 9 2008 3:34 pm
Subject: Re: Siple AJAX, of course
On May 9, 8:57 pm, Tom Cole <tco...@gmail.com> wrote:

> Does your server indeed return a valid XML document with content-type
> of "text/xml" and what does the entire XML document look like?

There was a problem in my form tag.  This was the oldest one:
<form method="GET" action="/lbs/" onSubmit="filterMarkers();false" >

And the current one is
<form method="GET" action="/lbs/" onsubmit="return filterMarkers()" >

Now everything works.  Thanks anyway.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google