[Solar-talk] isXml

Arnaud Limbourg arnaud at limbourg.com
Thu Jan 18 22:21:25 PST 2007


Rodrigo Moraes wrote:
> On 10/19/06, Paul M Jones wrote:
>> This is a recent development, but you can check $this->_request->isXml
>> () to see if the "X-Requested-With" header is "XmlHttpRequest".  Easy
>> AJAX recognition; thank Clay for having that idea.  :-)
> 
> isXml is a very nice idea (thanks, Clay), and I found it so useful
> that I have set a $is_xml public property in my app so I have a short
> way to check it in views.
> 
> However, I always feel that the name is strange (when I use isXml I
> think in XML itself, and not in XMLHttpRequest). Rail uses
> request.xhr, so I was thinking if isXhr wouldn't be more appropriate
> and easy to recognize. Just an idea, though, and not very important of
> course. :-)

isXHR is indeed clearer imho.

Anither idea is isAsync

Arnaud.



More information about the solar-talk mailing list