473,387 Members | 1,516 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,387 software developers and data experts.

"prototype.js" & responseXML

Doesn't "prototype.js" support the "responseXML" property of the
XMLHttpRequest object?

var url = "test.jsp";
var pars = "";
var myAjax =
new Ajax.Request(url,
{method: 'get', parameters: pars,
onComplete: mycallback }
);

"test.jsp"
<%
String sXml;
sXml = "<?xml version='1.0' encoding='utf-8' ?>";
sXml += "<response>aaa</response>";
%>
<%=sXml%>

"callbackfunction"
function mycallback(req)
{
alert(req.responseText); // ok!
if (req.responseXML == null)
alert("does not work!");
// req.responseXML seems to be null
}

Feb 2 '06 #1
2 6731
eschl said the following on 2/2/2006 7:53 AM:
Doesn't "prototype.js" support the "responseXML" property of the
XMLHttpRequest object?


Why don't you ask the people who wrote it?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 2 '06 #2
I seem to remember something about responseText being populated on
Content-type: text/html responses and responseXML being populated on
text/xml responses.

You can either set the content type from the server (php has a "header"
function) or you can override it at the client. See details at the
link. Please post back here if it worked for you. Also where is the
Ajax object defined?

http://developer.mozilla.org/en/docs...etting_Started

Feb 2 '06 #3

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

Similar topics

5
by: Derek Ross | last post by:
Hello, Say I have a server that's saving the CPU temperature to 'temperature.js' once a second. The contents of the file is one single line: var temperature = "35.5"; And it changes as...
5
by: Charles Crume | last post by:
Hello all; I've been able to locate, and download, the source for "animate.js" from a number of web sites, but have not been able to find *any* documentation on this script. Does anyone have...
4
by: Dmitry | last post by:
Hello, Sometimes on js code execution Mozilla 1.5 prints in JS concole the following error: "Error: fn is not defined" where "fn" is the function name surely defined _before_ the line that...
7
by: RFS666 | last post by:
Hello, I would like to use variables with a type in jscript.NET. I declare them as follows: var x : double = 5.03; This doesn't work in my script, that I write to the page in codebehind with...
1
by: drnicwilliams | last post by:
The Prototype library gives us the $() operation for converting a DOM element id into the DOM element: $('element-id'). It also appends a bunch of functions to the resulting object. Sometimes...
0
by: carllucas | last post by:
i'm using action script 1.0 I'm try to create a "class" using prototype. I then want to apply an onEnterFrame function on this new object. I can successfully create the object but I can't get the...
1
by: santhoskumara | last post by:
suppose i have two javascript file, where my jsp page need both the .js file. how will i import to my page. whether i need to put a two script tag and mention the path value in the src attribute...
9
by: Mahernoz | last post by:
Hello Friends, The JavaScript File exmplmenu_var.js contains the code... (for the sake of brevity i am showing only that code which needs to be changed) I am actually developing a menu using...
3
by: joe | last post by:
Is it OK to have multiple: <script type="text/javascript" src="funcs1.js"></script> <script type="text/javascript" src="funcs2.js"></script> <script type="text/javascript"...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.