


javascript - 像那些广告联盟,是怎么实现的呢,比如我淘宝上搜一个商品,然后优酷看视频,其它一些乱七八糟的广告百度联盟的啊,都是相关的推荐广告?
像那些广告联盟,是怎么实现的呢,比如我淘宝上搜一个商品,然后优酷看视频,其它一些乱七八糟的广告百度联盟的啊,都是相关的推荐广告?
这个是怎么实现的呢,不同网站不是不能实现cookie共享的吗?
难道其实他们都是合作的,或是怎么搞的,感觉有点神了?
有高手详细的解释下原理吗?
谢谢了!
回复内容:
像那些广告联盟,是怎么实现的呢,比如我淘宝上搜一个商品,然后优酷看视频,其它一些乱七八糟的广告百度联盟的啊,都是相关的推荐广告?
这个是怎么实现的呢,不同网站不是不能实现cookie共享的吗?
难道其实他们都是合作的,或是怎么搞的,感觉有点神了?
有高手详细的解释下原理吗?
谢谢了!
谈一下百度联盟吧
首先,我们在使用百度的时候,百度会记录我们的操作行为。
比如:
这是我某一天的搜索记录。
百度会长期跟踪个人行为,然后对用户进行分析。包括性别,爱好等等
当然,也包括你使用的相关百度产品也会进行分析。
下面,站长在使用百度联盟的时候,就会根据你的相关信息,给你推荐相关内容。
这是我的网站ENUE,也加入百度联盟。
iframe
====补充====
这是腾讯网首页天猫广告的源码,腾讯网通过加载
http://p.tanx.com/ex?i=mm_26051537_2367569_21224084
这一段天猫的js,用于初始话广告,这端js会陆续的加载其他的天猫js,但最终要的是加载了
http://ope.tanx.com/ex?i=mm_26051537_2367569_21224084&cb=jsonp_callback_3386&callback=&userid=&o=&f=&n=&re=1920x1080&r=1&cah=1040&caw=1920&ccd=24&ctz=8&chl=2&cja=1&cpl=6&cmm=8&cf=19.0&cg=a9af6a03f12808613c16ff3d163de1dd&pvid=acee1495435d1164d78b4af9766fed19&pvid_1=e7f394a9f05512679be354485eb0a5c5&ai=0&ac=1537&prm=45906808&cas=prm&cbh=0&cbw=700&dx=1&u=http%3A%2F%2Fwww.qq.com%2F&k=&tt=alimama%20ad
这段js,是一段jsonp的数据,data字段包含了一个iframe字符串
"<iframe scrolling=\"no\" height=90 frameborder=\"0\" width=700 style=\"border: 0pt none;\" marginheight=\"0\" allowtransparency=\"true\" marginwidth=\"0\" border=\"0\" src=\"http:\/\/strip.taobaocdn.com\/tfscom\/TB1y4V6HpXXXXXIXFXXO04pFXXX.html?name=itemdsp&url=http%3A%2F%2Fwww.qq.com%2F&iswt=1&pid=tt_26051537_2367569_21224084&refpid=tt_26051537_2367569_21224084&refpos=,n,i&adx_type=0&pvid=0ab7409100005656702e17b903bd0151_0&ps_id=acee1495435d1164d78b4af9766fed19&fl=3&tanxdspv=http%3a%2f%2frdstat.tanx.com%2ftrd%3ff%3d%26k%3da09e279ad7f7a12a%26p%3dmm_26051537_2367569_21224084%26pvid%3d0ab7409100005656702e17b903bd0151%26s%3d700x90%26d%3d17534123%26t%3d1448505390\"><\/iframe><img src=\"http:\/\/dsp.simba.taobao.com\/feedback?bid=0ab7409100005656702e17b903bd0151&v=1&e=2&p=AQq3QJEAAFZWcC4XuQO9AVFYLrjIi7dXDg%3D%3D\" style="max-width:90%"0\" height=\"0\" \/ alt="javascript - 像那些广告联盟,是怎么实现的呢,比如我淘宝上搜一个商品,然后优酷看视频,其它一些乱七八糟的广告百度联盟的啊,都是相关的推荐广告?" >"
这个iframe的最终地址是
http://strip.taobaocdn.com/tfscom/TB1y4V6HpXXXXXIXFXXO04pFXXX.html?name=itemdsp&url=http%3A%2F%2Fwww.qq.com%2F&iswt=1&pid=tt_26051537_2367569_21224084&refpid=tt_26051537_2367569_21224084&refpos=,n,i&adx_type=0&pvid=0ab7409100005656702e17b903bd0151_0&ps_id=acee1495435d1164d78b4af9766fed19&fl=3&tanxdspv=http%3a%2f%2frdstat.tanx.com%2ftrd%3ff%3d%26k%3da09e279ad7f7a12a%26p%3dmm_26051537_2367569_21224084%26pvid%3d0ab7409100005656702e17b903bd0151%26s%3d700x90%26d%3d17534123%26t%3d1448505390
题主自己用浏览器打开一下这个地址,就是那个广告。
另外题主可以上网随便百度一下js跨越访问的相关知识(随手帮你找了http://www.cnblogs.com/2050/p/3191744.html),window.name,windon.domain,iframe,jsonp,postMessage等技术都可以完成跨越访问。

ThesecrettokeepingaPHP-poweredwebsiterunningsmoothlyunderheavyloadinvolvesseveralkeystrategies:1)ImplementopcodecachingwithOPcachetoreducescriptexecutiontime,2)UsedatabasequerycachingwithRedistolessendatabaseload,3)LeverageCDNslikeCloudflareforservin

You should care about DependencyInjection(DI) because it makes your code clearer and easier to maintain. 1) DI makes it more modular by decoupling classes, 2) improves the convenience of testing and code flexibility, 3) Use DI containers to manage complex dependencies, but pay attention to performance impact and circular dependencies, 4) The best practice is to rely on abstract interfaces to achieve loose coupling.

Yes,optimizingaPHPapplicationispossibleandessential.1)ImplementcachingusingAPCutoreducedatabaseload.2)Optimizedatabaseswithindexing,efficientqueries,andconnectionpooling.3)Enhancecodewithbuilt-infunctions,avoidingglobalvariables,andusingopcodecaching

ThekeystrategiestosignificantlyboostPHPapplicationperformanceare:1)UseopcodecachinglikeOPcachetoreduceexecutiontime,2)Optimizedatabaseinteractionswithpreparedstatementsandproperindexing,3)ConfigurewebserverslikeNginxwithPHP-FPMforbetterperformance,4)

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

WebStorm Mac version
Useful JavaScript development tools
