Posted By

TC on 09/12/06


Tagged

ajax php


Versions (?)


Advertising

Website Promotion DIRECTORY is a crucial factor for all websites that need to gain better organic search engine rankings and increase website traffic.
Submitting your website as part of your Web Promotion strategy to our SEO friendly and high traffic Business Directory for review is an excellent way to gain a valuable backlink and increase your websites visibility online.

Submit Site


Who likes this?

30 people have marked this snippet as a favorite

Hollow
frankyfish
simpeligent
vali29
willcodeforfood
jeff
Steffen82
romanos
grn
ki4ngel
dave333
elgermano
handcoding
troynt
umang_nine
nb109
pdswan
obsessivejosh
TheDeveloper
FSX
xmartyxcorex
sultano
kellyrmartin
kitzelh
Knarf
Adam42
Rawrcasm
liamchapman
kanampo
khaled


Check for AJAX Request


Published in: PHP 






A simple function to check if the request comes from an AJAX XMLHttpRequest. Use it if your page should behave differently when called from AJAX. Comes from jquery mailing list: http://jquery.com/discuss/2006-June/006656/

Expand | Embed | Plain Text
  1. function isAjax() {
  2. return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
  3. ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'));
  4. }

Report this snippet 

You need to login to post a comment.