Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.5.6

Request #9962 Add method to check if the page request is from Ajax
Submitted: 2007-01-29 00:50 UTC Modified: 2007-03-05 16:23 UTC
From: lsolesen Assigned: jeichorn
Status: Closed Package: HTML_AJAX (version 0.5.0)
PHP Version: 5.2.0 OS: Irrelevant
Roadmaps: 0.5.1    
Subscription  


 [2007-01-29 00:50 UTC] lsolesen (Lars Olesen)
Description: ------------ I want to make pages which are usable without Ajax, and I don't want to code more than I have to. Therefore it would be nice if HTML_Ajax could tell me if the request to a page was Ajax-related or not. Test script: --------------- <?php // business logic if ($_SERVER['REQUEST_METHOD'] == 'POST') { // something is fetched from a database if ($ajax->isAjax()) { echo 'The Ajax response so it can be used on the page'; } else { // reload page header('Location: page.php'); exit; } } ?>

Comments

 [2007-03-05 16:23 UTC] jeichorn (Joshua Eichorn)
isAJAX method added to HTML_AJAX_Helper in svn