¿Espera la etiqueta Meta Refresh (retraso cero) a que la página termine de cargarse?

Does the Meta Refresh tag (with a delay of 0) wait for all components of page to load \ all scripts to finish executing before performing redirect?

I have the following page tag in the HTML document's head:

<meta http-equiv="refresh" content="0;url=http://example.com/">

the HTML document contains other stuff such as script tags linking to remote Javascript (e.g. Google Analytics), and Javascript code that performs AJAX request.

Can I count on everything to get run? Or may the browser cancel downloading scripts \ performing AJAX \ running scripts mid-way due to a redirect?

(am aware of the option of implementing with Javascript instead of Meta tag, would like to know about Meta tag)

preguntado el 01 de febrero de 12 a las 14:02

1 Respuestas

"Can I count on everything to get run?" - No

It is context dependent, i.e how the page is composed and which user agent you are talking about. It's not fool proof.

Why not do the redirect server-side using Response.Redirect (.NET) or header("Location:"); (PHP)?

Respondido el 25 de Septiembre de 12 a las 18:09

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