网站重定向:对 Facebook 方式的研究和质疑
我开发了一个网站,其中包含其他网站的网址。我想让它重定向,但记录重定向上的点击。
我试图找到 facebook 的做法,只是为了学习并提供了以下代码:
<html>
<body>
<script type="text/javascript">
/* <![CDATA[ */
document.location.replace($url);
/* ]]> */
</script>
<script type="text/javascript">
/* <![CDATA[ */
setTimeout("(new Image()).src='/laudit.php?r=JS&u%5Bprotocol%5D=http&u%5Bdomain%5D=www.youtube.com&u%5Bport%5D&u%5Bpath%5D=%2Fwatch&u%5Bquery%5D%5Bv%5D=uZ2sPofyjXc&u%5BrawQueryString%5D=v%3DuZ2sPofyjXc';",5000);
/* ]]> */</script>
</body>
我的问题是:将 url 放入图像源和超时内的目的是什么? 我猜是调用审核页面,使用超时来模拟对页面的一种异步调用,并创建一个“虚构”图像,只是为了调用 URL?
I have developed a site that has urls to other sites. I would like to make it redirect but log the click on the redirection.
I tried to find the way facebook does this, just to learn and came with this code:
<html>
<body>
<script type="text/javascript">
/* <![CDATA[ */
document.location.replace($url);
/* ]]> */
</script>
<script type="text/javascript">
/* <![CDATA[ */
setTimeout("(new Image()).src='/laudit.php?r=JS&u%5Bprotocol%5D=http&u%5Bdomain%5D=www.youtube.com&u%5Bport%5D&u%5Bpath%5D=%2Fwatch&u%5Bquery%5D%5Bv%5D=uZ2sPofyjXc&u%5BrawQueryString%5D=v%3DuZ2sPofyjXc';",5000);
/* ]]> */</script>
</body>
My question is: what is the purpose to put a url inside an image source and inside a timeout?
I guess it's to call an audit page, using timeout to simulate a kind of async call to the page, and create a "ficticious" image, just to call the URL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也遇到过这个,很好奇。
我相信他们只是跟踪加载缓慢或无法正确重定向的页面(
如果 laudit.php 执行时间超过 5 秒(5000)),然后他们跟踪它并执行一些后端操作。
但是,如果 javascript 重定向脚本在规定时间内有效,则 laudit 跟踪器将不会执行。
也许 Facebook 稍后会对该网站进行更多检查,可能只是一些分析或出于性能目的,
我认为 laudit 意味着链接审核
Encountered this one too, and got curious.
I believe they are just tracking the pages which loads slow or doesn't redirect correctly
if it takes more than 5 secs (5000) the laudit.php will execute, then they track it and do some back-end stuffs.
But if the javascript redirect script works within the time, the laudit tracker won't execute.
Maybe facebook is doing some more checks later on about the site, probably just some analytics or for performance purpose
I think laudit means link audit