Snippets

Create an account or login to be able to add, comment and rate snippets.

Navigation

Refine Tags

Snippets tagged "request http" Snippets tagged "request http"

Detect an Ajax request

A simple way to detect an ajax request.

In your action class.

$this->isAjaxCall = $this->getRequest()->isXmlHttpRequest();

I put the above line in my preExecute where needed, this way the variable is accessible by action and views.

by Fuad Arafa on 2006-10-27, tagged ajax  http  request 
(2 comments)