I can think of a way, but it uses kinda heavy PHP. (See "Advanced escaping" at http://www.php.net/manual/en/language.basic-syntax.php.)
Code:
<?php
$ajax = isset($_REQUEST['ajax']) && $_REQUEST['ajax'] == 'true';
if($ajax){
?>
<html>
<head>
...
</head>
<body>
Anything that repeats across pages or shouldn't be received by AJAX for some other reason.
<?php
}
?>
All the stuff you want to send whether AJAX is being used or not.
<?php
if($ajax){
?>
</body>
</html>
<?php
}
?>
Now when you request that page, add ajax=true to the query string (for either GET or POST).
Bookmarks