Read more

Don't follow Ajax requests with a redirect

Tobias Kraze
August 06, 2012Software engineer at makandra GmbH

The behaviour of browsers is very inconsistent when an Ajax request is answered with a redirect. Highlights are:

  • IE 9 will follow a DELETE request with a second DELETE. You never want that.
  • Firefox will follow a POST request with a GET, as you might expect. If a PUT is redirected however, you will get a confirmation dialog, where you can choose to follow with a second PUT or simply abort. You don't want that either.
Illustration book lover

Growing Rails Applications in Practice

Check out our e-book. Learn to structure large Ruby on Rails codebases with the tools you already know and love.

  • Introduce design conventions for controllers and user-facing models
  • Create a system for growth
  • Build applications to last
Read more Show archive.org snapshot

See some workarounds here.

Posted by Tobias Kraze to makandra dev (2012-08-06 14:15)