简体   繁体   中英

How to make jQuery popup message on first page load?

I'm working in a web application using ASP.NET in C#, I wanted to implement a popup message to inform user that new features is available, it is similar with Facebook new feature message.

The popup should be trigger only in home page and first time load by users, the location of the popup message is fixed and it should be gone when page scroll to bottom.

My problem is how can I track the page load is home page and is the first time for the user? and any jQuery plugin able to help on the popup message?

Thank you in advanced.

You can do an ajax request that calls a controller that creates a session indicating that it is the first page load.

Based on the result , flag the popup.

Just google for jQuery popup solutions. There are loads of them.

To show popup only on home page, you can use:

jQuery(location).attr('href');

And to show it only one time, you can set cookie .

Here is very good plugin for jQuery for cookies: https://github.com/carhartl/jquery-cookie

It lets you set cookie as easy as:

$.cookie("cookieName", "cookieValue");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM