Home > Web Front-end > JS Tutorial > body text

Information monitoring example of JS code in web advertising_javascript skills

WBOY
Release: 2016-05-16 16:53:49
Original
957 people have browsed it

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.
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!