Home > Article > Backend Development > How to pop up prompt box and jump in php
How to implement pop-up prompt box and jump in php
First download the layer pop-up plug-in and introduce the plug-in; then request php in the js code Carry out business operations. After the operation is successful, use "layer.msg()" to prompt the message returned by the request; finally, after setting the prompt, just jump to the page.
Code Example
$(function(){ $.post('./action.php', { name: 'xiaoming' }, function(data){ if (data.code == 1) { layer.msg(data.msg, function(){ window.location.href = data.url; }); } else { layer.msg(data.mg); } }); });
Recommended tutorial: "PHP Tutorial"
The above is the detailed content of How to pop up prompt box and jump in php. For more information, please follow other related articles on the PHP Chinese website!