JavaScript special effect instance 006-Cookie control in the pop-up window, 006-cookie

Source: Internet
Author: User

JavaScript special effect instance 006-Cookie control in the pop-up window, 006-cookie
In the pop-up window of instance 006, the Cookie control instance is used to make the same advertisement information not pop up every time the webpage is opened, but only pop up when the webpage is opened for the first time. Technical tips cookies are some customized information segments stored on the visitor's hard disk. Through a browser, web pages can store, retrieve, and delete cookies. The Cookie has only one purpose, that is, to record the individual information of the visitor. Before using cookies, we need to know the following rules. The total number of cookies that a browser can store cannot exceed 300, and each server cannot exceed 20 (for the entire server, not just your own webpage or website ). The storage capacity is limited to 4 kb for each cookie, So do not try to store too much information in a Cookie. By default, a Cookie can exist during the entire browser. When the user leaves the browser, the Cookie content disappears. To allow a Cookie to last longer than a browsing period, you can set an expiration date. Implementation Process (1) Advertisement page new.html

<Html> (2) On the page where an advertisement window needs to be displayed, check whether the specified Cookie exists in the browser of the client. If no Cookie exists, the advertisement information is displayed in the new window. Otherwise, no advertisement information is displayed.

<Html> Note: The content of the style label is css. We focus on the content in the script label. In this way, our instance is ready.


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.