为什么Facebook使用PHP链接的img标签 [英] Why does Facebook uses the img tag with PHP link
问题描述
< img style = -webkit-user-select:nonesrc =https://pixel.facebook.com/ajax/ego_height.php?sid=ads&fbid=34324234&height=0&asyncSignal=4815& ;安培; __用户= 23232323&放大器;放大器; __一个= 1&放大器;放大器; fb_dtsg = AQCVSss>
为什么Facebook使用这个 img
标签致电 PHP 文件?
这实际上是一个很常见的做法。
由于安全性原因,您无法执行 Ajax 请求到第三方域。而您真的别无选择,只能通过加载图像发送数据,或者加载实际上是服务器端代码的JavaScript代码。或者您可以同时执行(如 Google Analytics(分析)),他们只需加载JavaScript即可处理所有事件页面,并通过加载具有分析参数的像素图像进行注册)。
I was debugging a few things, and at that time I found the following image tag:
<img style="-webkit-user-select: none" src="https://pixel.facebook.com/ajax/ego_height.php?sid=ads&fbid=34324234&height=0&asyncSignal=4815&__user=23232323&__a=1&fb_dtsg=AQCVSss">
Why does Facebook use this img
tag for calling a PHP file?
That's actually a pretty common practice.
Due security reasons, you're not able to do an Ajax request to a third-party domain. And you really have no choice but sending data by loading an image OR loading JavaScript code which is actually server-side code. Or you can do both (as Google Analytics works, they just load JavaScript which handles all events on the page and register them by loading a pixel image with analytics parameters passed).
这篇关于为什么Facebook使用PHP链接的img标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!