Closed
Bug 342137
Opened 20 years ago
Closed 20 years ago
XMLHttpRequest object return value points syntax error at JavaScript console and Firebug
Categories
(Core :: XML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 311724
People
(Reporter: fernando.wendt, Unassigned)
References
()
Details
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.
Comment 1•20 years ago
|
||
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
Comment 2•20 years ago
|
||
Also include the exact error displayed in the error console.
Updated•20 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•20 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
Comment 4•20 years ago
|
||
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
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•