Home >Web Front-end >JS Tutorial >Information monitoring example of JS code in web advertising_javascript skills

Information monitoring example of JS code in web advertising_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:53:491007browse

The JS code provided in some webpage advertisements can be code injected and then monitor various elements.
The following example is to monitor the input value of the Baidu input box and then display it,

Copy code The code 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);

//Read the cookie value here, and then call an ajax to upload it to the local server.
<.>})();

This method allows the advertising JS code to monitor the content, 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 ads are opened on other websites, some ads can be pushed to the current website based on information about previous visits to the website.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn