Stats

Wow, I tried a MILLION solutions to this,
and some of them worked...almost...perfectly...
and along the way I learned A LOT,
including some awesome JavaScript and PHP logic, URL sniffers, decision makers, GLOBALS, and so on...
but now, of course, the TRUE solution,
and duh, of course, it's SIMPLE, the SIMPLEST

Scenario, AJAX framework,
loads external pages into a div in the framework,
we don't want said external pages loaded by themselves, that is, their URLs should be visit-able...

Solution:
when AJAX function that loads an external page calls for it,
it also submits with its request a form, or a variable, to the page being loaded in,
page being called looks for that variable,
and without it, follows another line of action,
DUH!

example using Prototype AJAX functions:

AJAX.Updater Version:
button or link on framework base main page calls this function below, sending the variable camefromhome (could be anything), with a value of camefromhome (again, could be anything), requesting that page_to_load be loaded into the div_to_fill div: