Home >Backend Development >PHP Tutorial >javascript - How to implement a pop-up window when entering the homepage of a website?
As soon as you enter, a prompt pops up in the middle
As soon as you enter, a prompt pops up in the middle
I think it should be the window.onload event
alert("The content you want to pop up");
(function(){alert('');})()
Alert can be solved, but the experience is not good.
Recommend a lightweight jQuery
pop-up component
http://layer.layui.com/
It depends on how you want to implement it. The most common way is to give an alert prompt, or make a spring layer yourself, or use a spring layer library~