¿Cómo resolver los mensajes "Cancelados" de Firebug en las solicitudes de Ajax?

Estoy utilizando Firebug 1.10.2 with Firefox 14.0.1. When showing a web page, the Firebug add-on has this "behavior": Firebug’s “Aborted” message upon Ajax request.

What should I make? Is it so dangerous that I must improve my web application because the presence of some error, or it is a Firebug bug or something else?

preguntado el 24 de agosto de 12 a las 22:08

So what exactly is the question? DO you suspect a firebug bug? Try the built-in inspector in Chrome. You think you made the same mistake as in the article (reusing XMLHTTP requests prematurely)? Get rid of the reuse, get the functionality right at first, optimize later if needed at all. -

@Szocske - (1) Yes, I think I "made the same mistake as in the article". What "reusing XMLHTTP requests prematurely" exactly means? (2) Why I "could" / "may" get rid of the reuse? -

Just instantiate a new XHR object every time you need one. If it turns out to be a performance issue, you can always add a pool later. Trying to get by with just one XHR instance is premature optimization. -

@Szocske - You: "Just instantiate a new XHR object every time you need one". I: Practically speaking, are you referring to "unbind" something? PD: your last comment did not clarify at all my "sub" question (2)... is there a reason to "get rid of the reuse"? -

I don't understand what you mean by "unbind". You want to do an AJAX request? Create a new XHR instance. Sub question 2: Read the blog post you linked along with the XHR.open method document I quoted in the answer: if you reuse the same XHR instance before it's done, it gets "aborted". This is the reason you should not reuse one XHR instance and create a new one when you need one. Better yet, use jQuery or other library to shield you from such details. -

2 Respuestas

Please see the documentation of XHR open() for example here: https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest

Note: Calling this method an already active request (one for which open()or openRequest()has already been called) is the equivalent of calling abort().

Just create a new XHR instance whenever you need one. Better yet, use jQuery or other JS library to do AJAX. It should shield you from these intricacies.

Respondido 25 ago 12, 06:08

I saw this problem when trying to load a JavaScript file using HTTPS, but was serving the site on my local development environment using HTTP. The request to fetch the JavaScript file would fail with the Aborted message in FireBug. Making the requests use the same protocol worked for me.

Respondido 11 ago 14, 16:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.