XMLHttpRequest object return value points syntax error at JavaScript console and Firebug

RESOLVED DUPLICATE of bug 311724

Status

()

defect
RESOLVED DUPLICATE of bug 311724
13 years ago
13 years ago

People

(Reporter: fernando.wendt, Unassigned)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

()

Reporter

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3

When using a XMLHttpRequest object in some JavaScript file - i.e AJAX -, the string returned by processing the data request is being marked at JavaScript console and Firebug with a sintax error.

Even when changing the response header to some other content type (as "text/plain", "text/html" or "text/xml"), it happens.

Reproducible: Always

Steps to Reproduce:
1. Create some AJAX resource, by using a XMLHttpRequest object ("http_request" at this sample) to post data for external processing (with some server side, like PHP or ASP).

2. Add the follow line codes at the main AJAX function:

a)http_request.onreadystatechange = somefunction;
b)http_request.open('POST', url, true);
c)http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
d)http_request.send(data);

3. Return some string at the external request processing file as result;

4. Do anything whith the string data (use a window.alert simple test);

5. Look at the JavaScript console and/or FireBug message error.
Actual Results:  
Sintax error is pointed at both JavaScript Console and FireBug.

Expected Results:  
None kind of error. It´s just string data.
Well, it's not the error console's fault that someone's posting an error to it. If you only see it with Firebug installed, then it's a Firebugbug, and you should tell Hewitt about it, and if not, more detailed steps to reproduce, with maybe a testcase or example URL, would help.
Assignee: nobody → xml
Component: Error Console → XML
Product: Firefox → Core
QA Contact: javascript.console → ashshbhatt
Version: unspecified → Trunk
Also include the exact error displayed in the error console.

Updated

13 years ago
Summary: XMLHttpRequest object return value points sintax error at JavaScript console and Firebug → XMLHttpRequest object return value points syntax error at JavaScript console and Firebug
Reporter

Comment 3

13 years ago
OK, i have made one sample file, that show all the code above, and is a page test too. The URL bug field have been updated. Its http://www.fernandowendt.eti.br/bugzilla/

Enjoy.

Fernando
http_request.overrideMimeType('text/xml') tells Firefox to attempt to parse the response as text/xml, whatever the server claims the response actually is. So this is just bug 311724.


*** This bug has been marked as a duplicate of 311724 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.