How to pop up prompt box and jump in php

Guanhui
Release: 2023-03-01 06:46:02
Original
4926 people have browsed it

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);
      }
    });

  });
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!