Home  >  Article  >  Backend Development  >  How to pop up prompt box and jump in php

How to pop up prompt box and jump in php

Guanhui
GuanhuiOriginal
2020-05-09 14:43:274971browse

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!

Statement:
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