View Full Version : [CLOSED][3.0.1] Ext.Ajax.request causes firefox error when no entity returned

26 Aug 2009, 10:21 AM
Ext version tested:

Ext 3.0.1 Release

Adapter used:


css used:

only default ext-all.css

Browser versions tested against:

Firefox 3.0.13

Operating System:

Ubuntu 9.04
WinXP Pro SP3


When Making PUT/POST/DELETE request through Ext.Ajax.request, firefox throws an error, "no element found" on the URL when no entity is being returned by the server.
The issue does not appear using Ext 2.2.1
Workaround is to have the server return a string. But in the case of the provided example server(restlet), the put, post, and delete representation handlers do not have return types.(Though responses can still be set.)

Test Case:


url: '/bug/1',
method: 'DELETE',
success: function(response){
Ext.Msg.alert("DELETE","DELETE Successful.");
failure: function(response){
Ext.Msg.alert("DELETE","DELETE Failed.");

Java Resource

public void removeRepresentations() throws ResourceException {

//Do Something

//Workaround for the bug
//this.getResponse().setEntity(new StringRepresentation("{}"));

//Success Code will be returned

An Example Server with java source is available here: http://dl.getdropbox.com/u/1844040/Ext3BugReporting01.zip Read included README for startup instructions

Steps to reproduce the problem:

Run included server jar file specifying the running directory and http port to run on
Navigate to http://localhost:{port} in Firefox
Click on one of the Ext Buttons on the index page
Open Firefox's javascript console to see the result

The result that was expected:

No errors

The result that occurs instead:

"no element found" error is thrown

Screenshot or Video:

Error Console Image Attached
Example Page Image Attached

Debugging already done:

Found Server Side workaround: http://extjs.com/forum/showthread.php?t=77883
No ExtJS debugging has been done

Possible fix:

not provided

26 Aug 2009, 10:53 PM
I can't confirm this.

I modified the restful example in the 3.x download.


url: 'app.php/users/5',
method: 'DELETE',
success: function(response){
Ext.Msg.alert("DELETE","DELETE Successful.");
failure: function(response){
Ext.Msg.alert("DELETE","DELETE Failed.");

Modified the destroy function on the server:

public function destroy() {
$res = new Response();
if (User::destroy($this->id)) {
$res->success = true;
$res->message = 'Destroyed User ' . $this->id;
} else {
$res->message = "Failed to destroy User";
return '';
return $res->to_json();

The response, as you can see, returns nothing. However the success method is still called.

26 Aug 2009, 10:55 PM
This might be useful:


27 Aug 2009, 10:20 AM
EDIT: I will see if the media type changes things.

I had just assumed it was a Bug when it works fine in Ext 2

Nope, I still get the error, on multiple computers using the restlet server.

The issue appears to be the content type. Even though nothing is returned from your PHP request, your content-type was set in your header, I imagine. In the case of the restlet server I have provided, it does not set a content type in the header unless it has content to return.

27 Aug 2009, 3:00 PM
Should I repost as a new bug, as the doesn't occur when no entity is returned, it happens when no content type is set?

27 Aug 2009, 9:52 PM
It would be helpful if you could setup a public viewable page.

28 Aug 2009, 3:17 PM

The PUT example will not throw an error because I have set it to return a blank string. (Just like your PHP example)

If you are able to look at the response header you will see content-type set for the PUT request.

The other two examples will throw the no element found error in firefox, and if you look at the response header you will not see a content-type set.

30 Aug 2009, 7:57 PM
I just went to your test page and I didn't see any errors thrown.

See the attached image.

31 Aug 2009, 8:40 AM
Hmm, Firebug does not seem to show the error, but the error is still in the builtin firefox console Tools->Error Console

Very odd...

I would argue that it is a firefox issue, but I have no idea why it isn't happening with Ext 2.2.1

17 Sep 2009, 9:47 AM
Looks like it is a Firefox issue, somehow it's avoided in Ext 2.

According to http://www.w3.org/TR/XMLHttpRequest , responses without Content-Types should default to the text/xml content type. (Makes sense, it is an XMLHttpRequest). But if the entity body is null, the responseXML should return null.

So that leads us to the same issue that you linked to above.

If you look at the response in firebug for my examples you will see that it has a responseXML object, and if you dive into that object you see 'parse error' on some of the objects.

It appears that firefox is not handling the response entity body being null.

13 Oct 2009, 10:15 AM
We have now logged it as a bug in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=521301

18 Oct 2009, 8:56 AM
I'm going to update the status to CLOSED since you've logged this problem to firefox.

26 Nov 2009, 1:42 AM
when i user Ext.Ajax.request request a file aspx, file aspx execute insert data into sql server the firefox message erro "no element found". (this is message file aspx return no object).

Help me! Thanks