我怎样才能确定是否页面通过收藏夹被查看?

问题描述:

我有几个网站我正在被加载通过收藏夹的子页面。实际的内容是由谷歌发现,但网页是可怕的,因为他们的目的不是加载所有页眉和诸如此类的东西 - 这是内容用于收藏夹交货(阿贾克斯,的fancybox)

I have several sites I'm working on that are loading sub-pages via lightbox. The actual content is being found by Google, but the pages are hideous as they aren't meant to load all the headers and whatnot - this is content intended for lightbox delivery (ajax, fancybox).

在PHP中,或者在必要的javascript,怎么可能我确定如果内容被观看的收藏夹或没有?会是不错的扔了一个查看原始网页链接什么的。

In PHP, or javascript if necessary, how might I determine if the content is being viewed in a lightbox or not? Would be nice to throw up a "view the original page" link or something.

收藏夹像其他类似的lib中使用AJAX拉的内容...我不知道知道你可以检测,如果它是一个标准的的jQuery moottools 收藏夹因为它们都在同一技术

lightbox like every other similar lib use AJAX for pulling content ... am not sure sure if you can detect if it is a standard jquery or moottools or lightbox because they all you the same technology

你可以做的是发现,如果你的页面被通过 AJAX

What you can do is detect if your page is been called via AJAX

function isAjax() {
    return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH']=="XMLHttpRequest");
}

if(isAjax())
{
    die("Don't Use AJAX");
}
else
{
    echo "WELCOME" ;
}