473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

IE7 XMLHTTPREQUEST reponseXML

Hi,

I have an Ajax call on my ASP page that calls another ASP which returns a
file which is data in XML format and the file is of content-type of text/xml.

This call works OK when used from IE6 (it uses the ActiveX object) but
something strange is happening under IE7.

Under IE7, the call works OK and I can do an alert(req.responseText) on the
client side and it displays the data returned in XML format.

But when I try to access the data using responseXML it keeps returning an
empty document. Even doing alert(req.responseXML.childNodes.length) displays
0, but I know that there is data.

Any ideas as to what is wrong?

I tried running under Firefox and it complains that the <?xml... is not on
the first line - and this is caused by the @Page directive inserting a blank
line - also any ideas on how to stop the page directive from creating blank
lines???

Thanks
Nov 23 '06 #1
4 2538
=?Utf-8?B?Sm9obiBCeXJuZQ==?= wrote on 23 nov 2006 in
microsoft.public.inetserver.asp.general:
Hi,

I have an Ajax call on my ASP page that calls another ASP which
returns a file which is data in XML format and the file is of
content-type of text/xml.

This call works OK when used from IE6 (it uses the ActiveX object) but
something strange is happening under IE7.

Under IE7, the call works OK and I can do an alert(req.responseText)
on the client side and it displays the data returned in XML format.

But when I try to access the data using responseXML it keeps returning
an empty document. Even doing alert(req.responseXML.childNodes.length)
displays 0, but I know that there is data.

Any ideas as to what is wrong?

I tried running under Firefox and it complains that the <?xml... is
not on the first line - and this is caused by the @Page directive
inserting a blank line - also any ideas on how to stop the page
directive from creating blank lines???
Wouldn't that be a clientside problem?

ASP does not know about browsers.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 23 '06 #2

"John Byrne" <Jo*******@discussions.microsoft.comwrote in message
news:D4**********************************@microsof t.com...
Hi,

I have an Ajax call on my ASP page that calls another ASP which returns a
file which is data in XML format and the file is of content-type of
text/xml.
>
This call works OK when used from IE6 (it uses the ActiveX object) but
something strange is happening under IE7.

Under IE7, the call works OK and I can do an alert(req.responseText) on
the
client side and it displays the data returned in XML format.

But when I try to access the data using responseXML it keeps returning an
empty document. Even doing alert(req.responseXML.childNodes.length)
displays
0, but I know that there is data.

Any ideas as to what is wrong?

I tried running under Firefox and it complains that the <?xml... is not on
the first line - and this is caused by the @Page directive inserting a
blank
line - also any ideas on how to stop the page directive from creating
blank
lines???
Whitespace before the <?xml declare is invalid according to the XML spec.
However earlier implementations of MSXML were more forgiving and simply
ignored it. Later implementations (MSXML3 and above) were more strict
however they continued to keep faith with the earlier implementations when
invoked from CLSIDs and ProgIDs of the older versions.

XMLHttpRequest being a very recent addition to IE7 will stick strictly to
the standards.

ASP has an unfortunate behaviour in this regard:-

<!-- #include virtual="/someinclude.asp" -->
<html>
<body>
...

The CRLF before the <htmltag is included in the response of the inline
content hence extra whitespace at the start.

However something like this:-

<!-- #include virtual="/someinclude.asp" -->
<%
Response.Write "<html>"
%>
<body>

Does not suffer this problem because ASP does not create send the CRLF that
preceeds an inline script.

Frankly any ASP code that sends XML ought to be purely script with no inline
content to be sent at all. Would it be a good guess that this page is not
using an XML DOM to build the XML to be sent?


>
Thanks

Nov 23 '06 #3

"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
=?Utf-8?B?Sm9obiBCeXJuZQ==?= wrote on 23 nov 2006 in
microsoft.public.inetserver.asp.general:
Hi,

I have an Ajax call on my ASP page that calls another ASP which
returns a file which is data in XML format and the file is of
content-type of text/xml.

This call works OK when used from IE6 (it uses the ActiveX object) but
something strange is happening under IE7.

Under IE7, the call works OK and I can do an alert(req.responseText)
on the client side and it displays the data returned in XML format.

But when I try to access the data using responseXML it keeps returning
an empty document. Even doing alert(req.responseXML.childNodes.length)
displays 0, but I know that there is data.

Any ideas as to what is wrong?

I tried running under Firefox and it complains that the <?xml... is
not on the first line - and this is caused by the @Page directive
inserting a blank line - also any ideas on how to stop the page
directive from creating blank lines???

Wouldn't that be a clientside problem?
No.
ASP does not know about browsers.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Nov 23 '06 #4
1) Clear the RC/LF that follows the directive in your editor

Or

2 )My personal preference would be likely to use Response.Clear to clear
this extra character before starting the XML output

--
Patrice

"John Byrne" <Jo*******@discussions.microsoft.coma écrit dans le message
de news: D4**********************************@microsoft.com...
Hi,

I have an Ajax call on my ASP page that calls another ASP which returns a
file which is data in XML format and the file is of content-type of
text/xml.

This call works OK when used from IE6 (it uses the ActiveX object) but
something strange is happening under IE7.

Under IE7, the call works OK and I can do an alert(req.responseText) on
the
client side and it displays the data returned in XML format.

But when I try to access the data using responseXML it keeps returning an
empty document. Even doing alert(req.responseXML.childNodes.length)
displays
0, but I know that there is data.

Any ideas as to what is wrong?

I tried running under Firefox and it complains that the <?xml... is not on
the first line - and this is caused by the @Page directive inserting a
blank
line - also any ideas on how to stop the page directive from creating
blank
lines???

Thanks

Nov 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Matt Kruse | last post by:
I'm aware of the circular reference memory leak problem with IE/closures. I'm not sure exactly how to resolve it in this situation. Also, Firefox appears to grow its memory size with the same code....
21
by: Joe Attardi | last post by:
Hey all! I was reading over at the IE Blog the other day http://http://blogs.msdn.com/ie/] and read some interesting, and encouraging news. According to Sunava Dutta, an IE Program Manager,...
13
by: TLaufenberg | last post by:
I'm new to Javascript programming and I've run into a bit of a snag with making an XMLHttpRequest in the Safari browser. Actually, the request doesn't work in Firefox either but only when I use a...
5
by: Peter Michaux | last post by:
Hi, The FAQ correctly says the following: "Mozilla (NN6.2+, Firefox, Ice Weasle etc), Opera 7.6+, Safari1.2+, the Windows version of IE versions 5+, and some other browsers provide the XML...
1
by: Charlie | last post by:
I am trying to make an XMLHttpRequest which violates the default "same- origin"policy in Firefox. I checked the archives and found a method that should work but it does not. Below is the test code...
1
by: geevaa | last post by:
http://www.phpbuilder.com/columns/kassemi20050606.php3 XMLHttpRequest and AJAX for PHP programmers James Kassemi Introduction: Although the concept isn't entirely new, XMLHttpRequest...
1
by: Tarik Monem | last post by:
OK, I'm pretty sure this cannot work because I'm trying to use JavaScript (client-side) to write to an xml file (which is server-side) using XMLHttpRequest. Can I use PHP do what I'm trying to do?...
6
by: Patrick Nolan | last post by:
I'm working on cross-platform portability of some javascript. My Macintosh testing platform is rather old. It has Safari 1.3.2 and Internet Explorer 5.2. I got Safari working, but now IE is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.