A sample _javascript of JS code in Web Ads

Source: Internet
Author: User
In some web ads provided in the JS code can be injected into the code, and then monitor a variety of elements,
The following example is to monitor the input of the Baidu input box value, and then display it,
Copy Code code 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);

This reads the value of the cookie and then invokes an AJAX upload to the local server.

})();

This way so that the ads JS code can monitor the content, and you can read the cookie information for the current page, and then execute the AJAX code to upload the local data to your server, so that when the ad is opened, you can push some ads to the current site based on the information from the previous site.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.