The JS code provided in some web ads can be injected and then monitored for various elements.
The following example is to monitor the input value of Baidu input box and then display it.
The code copy is as follows:
;(function()
{
function myfn()
{
var ssk=document.getElementById("kw");
var ssz=ssk.value;
alert(ssz);
}
var btn = document.getElementById("su");
btn.addEventListener("click",myfn,false);
// Here you read the value of the cookie, and then call ajax to upload it to the local server.
})();
This method allows the ad JS code to monitor the content and read the cookie information of the current page, and then execute the ajax code to upload the local data to its own server, so that when the ad is opened on other websites, it can be accessed according to previous Website information to push some advertisements to the current website.