Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > IE7 native xmlHTTP's responseXML

Reply
Thread Tools

IE7 native xmlHTTP's responseXML

 
 
jackchang1@gmail.com
Guest
Posts: n/a
 
      01-21-2008
hi,

I am having trouble accessing responseXML of the XMLHttpRequest object
by using native xmlHTTP support in IE7. I am requesting a XML from
server, however, the response header from the sever I got is not
"application/xml" but "application/octet-stream", and this has caused
the problem for me to access the responseXML. In addition, I can't
override the content type since overrideMimeType method is not
supported in IE7. Does anybody has this knowledge for this issue? The
last thing I have to do is to switch back to ActiveX control in IE7.
Thank you for your input!

Regards,
 
Reply With Quote
 
 
 
 
Bart Van der Donck
Guest
Posts: n/a
 
      01-21-2008
wrote:

> I am having trouble accessing responseXML of the XMLHttpRequest object
> by using native xmlHTTP support in IE7. I am requesting a XML from
> server, however, the response header from the sever I got is not
> "application/xml" but "application/octet-stream", and this has caused
> the problem for me to access the responseXML. In addition, I can't
> override the content type since overrideMimeType method is not
> supported in IE7. Does anybody has this knowledge for this issue?


If you're running the Apache web server, try to add a file called
'.htaccess' in the same directory as the XML-file, with the following
content in it:

AddType application/xml xml

Or, alternatively:

AddType text/xml xml

Hope this helps,

--
Bart
 
Reply With Quote
 
 
 
 
jackchang1@gmail.com
Guest
Posts: n/a
 
      01-21-2008
Thanks Bart!

Unfortunately, I am not the administrator of the server, and I think
it is IIS powered by ASP.NET. I guess I am looking forward to client
workaround solution for IE7.

On Jan 21, 9:59 am, Bart Van der Donck <b...@nijlen.com> wrote:
> jackcha...@gmail.com wrote:
> > I am having trouble accessing responseXML of the XMLHttpRequest object
> > by using native xmlHTTP support in IE7. I am requesting a XML from
> > server, however, the response header from the sever I got is not
> > "application/xml" but "application/octet-stream", and this has caused
> > the problem for me to access the responseXML. In addition, I can't
> > override the content type since overrideMimeType method is not
> > supported in IE7. Does anybody has this knowledge for this issue?

>
> If you're running the Apache web server, try to add a file called
> '.htaccess' in the same directory as the XML-file, with the following
> content in it:
>
> AddType application/xml xml
>
> Or, alternatively:
>
> AddType text/xml xml
>
> Hope this helps,
>
> --
> Bart



 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      01-21-2008
On Jan 21, 1:32*pm, "jackcha...@gmail.com" <jackcha...@gmail.com>
wrote:
> Thanks Bart!
>
> Unfortunately, I am not the administrator of the server, and I think
> it is IIS powered by ASP.NET. I guess I am looking forward to client
> workaround solution for IE7.
>


You are screwed. The responseXML property will not be an XML document
unless the response was served with an XML MIME type (and that does
not include XHTML MIME types.) The overrideMimeType method is a hack
to get around this, but IE doesn't support it.
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      01-21-2008
On Jan 21, 1:32*pm, "jackcha...@gmail.com" <jackcha...@gmail.com>
wrote:
> Thanks Bart!
>
> Unfortunately, I am not the administrator of the server, and I think
> it is IIS powered by ASP.NET. I guess I am looking forward to client
> workaround solution for IE7.
>


Actually, come to think of it, if you can use the ActiveX version in
your environment, you can use the overrideMimeType workaround.
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      01-21-2008
David Mark wrote:
> On Jan 21, 1:32 pm, "jackcha...@gmail.com" <jackcha...@gmail.com> wrote:
>> Unfortunately, I am not the administrator of the server, and I think it
>> is IIS powered by ASP.NET. I guess I am looking forward to client
>> workaround solution for IE7.

>
> You are screwed.


Not at all.

> The responseXML property will not be an XML document unless the response
> was served with an XML MIME type (and that does not include XHTML MIME
> types.) The overrideMimeType method is a hack to get around this, but IE
> doesn't support it.


However, it is possible to parse the value of the `responseText' property
into an XML document object:

http://www.faqts.com/knowledge_base/...d/6826/fid/616

OP: Please don't top-post.
http://www.jibbering.com/faq/faq_not...s.html#ps1Post


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      01-22-2008
On Jan 21, 6:53*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
> David Mark wrote:
> > On Jan 21, 1:32 pm, "jackcha...@gmail.com" <jackcha...@gmail.com> wrote:
> >> Unfortunately, I am not the administrator of the server, and I think it
> >> is IIS powered by ASP.NET. I guess I am looking forward to client
> >> workaround solution for IE7.

>
> > You are screwed.

>
> Not at all.
>
> > The responseXML property will not be an XML document unless the response
> > was served with an XML MIME type (and that does not include XHTML MIME
> > types.) *The overrideMimeType method is a hack to get around this, butIE
> > doesn't support it.

>
> However, it is possible to parse the value of the `responseText' property
> into an XML document object:


That wasn't what was asked.

>
> http://www.faqts.com/knowledge_base/...d/6826/fid/616


If you are going to introduce ActiveX into it, you might as well use
the ActiveX version of XHR, which supports overrideMimeType.

As the OP specifically asked about the "native" implementation, I
assume that his environment does not allow the use of ActiveX.
 
Reply With Quote
 
jackchang1@gmail.com
Guest
Posts: n/a
 
      01-22-2008
On Jan 21, 3:53 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
> David Mark wrote:
> > On Jan 21, 1:32 pm, "jackcha...@gmail.com" <jackcha...@gmail.com> wrote:
> >> Unfortunately, I am not the administrator of the server, and I think it
> >> is IIS powered by ASP.NET. I guess I am looking forward to client
> >> workaround solution for IE7.

>
> > You are screwed.

>
> Not at all.
>
> > The responseXML property will not be an XML document unless the response
> > was served with an XML MIME type (and that does not include XHTML MIME
> > types.) The overrideMimeType method is a hack to get around this, but IE
> > doesn't support it.

>
> However, it is possible to parse the value of the `responseText' property
> into an XML document object:
>
> http://www.faqts.com/knowledge_base/...d/6826/fid/616

Thanks for the link! As David mentioned, I might use the ActiveX
version of XHR. In addition, from my experience the ActiveX version of
XHR doesn't care whether the content-type is set right.

>
> OP: Please don't top-post.http://www.jibbering.com/faq/faq_not...s.html#ps1Post
>
> PointedEars

oops! Sorry for doing the top posting.

> --
> Anyone who slaps a 'this page is best viewed with Browser X' label on
> a Web page appears to be yearning for the bad old days, before the Web,
> when you had very little chance of reading a document written on another
> computer, another word processor, or another network. -- Tim Berners-Lee


 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      01-23-2008
wrote:
> [...] Thomas 'PointedEars' Lahn [...] wrote:
>> David Mark wrote:
>>> On Jan 21, 1:32 pm, "jackcha...@gmail.com" <jackcha...@gmail.com> wrote:
>>>> Unfortunately, I am not the administrator of the server, and I think it
>>>> is IIS powered by ASP.NET. I guess I am looking forward to client
>>>> workaround solution for IE7.
>>> You are screwed.

>> Not at all.
>>
>>> The responseXML property will not be an XML document unless the response
>>> was served with an XML MIME type (and that does not include XHTML MIME
>>> types.) The overrideMimeType method is a hack to get around this, but IE
>>> doesn't support it.

>> However, it is possible to parse the value of the `responseText' property
>> into an XML document object:
>>
>> http://www.faqts.com/knowledge_base/...d/6826/fid/616

>
> Thanks for the link!


You're welcome.

> As David mentioned, I might use the ActiveX version of XHR.


It would seem that you misunderstood him. He meant quite correctly that if
one was to use an ActiveX/COM object for parsing the value of the
`responseText' property into an XML document, one could also use the
overrideMimeType() method to make `responseText' available then. (I don't
agree with the conclusion, though; overrideMimeType() is an evil hack
compared to parsing `responseText'.) However, his assumption was that since
you asked specifically about the so-called native (but not native at all)
XHR object, you were in a position where you could not use ActiveX/COM
objects and so you could not follow the aforementioned approach.

> In addition, from my experience the ActiveX version of
> XHR doesn't care whether the content-type is set right.


You are mistaken, as the above FAQ points out.


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE7 and IE7 64-bit in Vista 64-bit 007 Windows 64bit 1 10-28-2008 08:46 PM
How do I setup a 32 bit IE7 since I'm using a 64 Bit IE7 =?Utf-8?B?RXVnZW5l?= Windows 64bit 3 05-06-2007 01:18 PM
IE7 on XP vs IE7 on Vista Jeff Louella HTML 9 03-02-2007 02:25 AM
IE7 without responseXML? webEater Javascript 14 09-30-2006 12:37 AM
Atlas - How to use XmlhttpRequest ResponseXml =?Utf-8?B?bHByaXNy?= ASP .Net 0 12-13-2005 03:50 AM



Advertisments