List Info

Thread: Re: transportXML returns null?




Re: transportXML returns null?
country flaguser name
United States
2007-09-27 18:16:52
You have to set a correct content-type (application/xml).

Regards,

Tobie

On Sep 28, 12:39 am, AlexK <alexkoif...gmail.com> wrote:
> Hi,
>
> I want to load an XHTML file into DOM.  I issue
Ajax.Request and on
> success do:
>  var response=transport.responseXML
>
> Response is null.  On the other hand:
>   var response=transport.responseText;  // has the
data.
>
> Why is response=transport.responseXML returns null?
>
> Here is the code:
>
>     function display() {
>        url = "http://" + location.hostname +
port + "/fusion/
> restlet/";
>        url = url + "engines" + sServer;
>         new Ajax.Request(url,
>         {
>             method:"get",
>            
contentType:"application/xhtml+xml",
>             onSuccess: function(transport) {
>
>                 var response = transport.responseXML;  
 // null ?
>                 //var response =
transport.responseText;  // OK
>
>                 alert("after response=" +
response);
>                 if (response != null) {
>                 alert("b=" +
> response.getElementById('lastUpdate').innerHTML);  //
this never works
>                }
>                 else
>                     alert("onSuccess, responseXML
is null");
>             },
>             onFailure: function(){ alert("Cannot
get data from server:
> " + location.host) }
>         });
>     }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=
en
-~----------~----~----~----~------~----~------~--~---


Re: transportXML returns null?
country flaguser name
United States
2007-09-27 23:25:08
Hi, this:
contentType: "application/xml"

did not change anything.  ANy other ideas?  Thanks.

On Sep 27, 7:16 pm, Tobie Langel <tobie.lan...gmail.com> wrote:
> You have to set a correct content-type
(application/xml).
>
> Regards,
>
> Tobie
>
> On Sep 28, 12:39 am, AlexK <alexkoif...gmail.com> wrote:
>
>
>
> > Hi,
>
> > I want to load an XHTML file into DOM.  I issue
Ajax.Request and on
> > success do:
> >  var response=transport.responseXML
>
> > Response is null.  On the other hand:
> >   var response=transport.responseText;  // has the
data.
>
> > Why is response=transport.responseXML returns
null?
>
> > Here is the code:
>
> >     function display() {
> >        url = "http://" + location.hostname +
port + "/fusion/
> > restlet/";
> >        url = url + "engines" + sServer;
> >         new Ajax.Request(url,
> >         {
> >             method:"get",
> >            
contentType:"application/xhtml+xml",
> >             onSuccess: function(transport) {
>
> >                 var response =
transport.responseXML;    // null ?
> >                 //var response =
transport.responseText;  // OK
>
> >                 alert("after response="
+ response);
> >                 if (response != null) {
> >                 alert("b=" +
> > response.getElementById('lastUpdate').innerHTML); 
// this never works
> >                }
> >                 else
> >                     alert("onSuccess,
responseXML is null");
> >             },
> >             onFailure: function(){
alert("Cannot get data from server:
> > " + location.host) }
> >         });
> >     }- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=
en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )