advertisement banner show only once in browser session
问题 How do you show an advertisement banner only once during a browser session using JavaScript or jQuery in a website? Once the session is closed and the browser is closed, the ad must be shown again when I open the website in the browser again. One more thing when i navigate across website banner must display unless it is not closed. 回答1: You can use cookie to remember if ad was displayed or not. You can use this plugin: https://github.com/carhartl/jquery-cookie Make a method to display the ad: