PHP implementation controls the foreground popup dialog box method

Source: Internet
Author: User
This article to you to share through the PHP echo out JavaScript script to control the foreground pop-up dialog box effect, very good, with reference value, interested friends to see it

Application Scenarios:

Authorization login process, users need to confirm, it is derived from this demand;

The reason why the corresponding logic is not put on the front end is that this part of logic belongs to the partial function business, so it is put on the back end, it is convenient for unified management.

Workaround:

With the PHP echo out of the JavaScript script, the one thing to focus on here is the buffer.

Buffer should have three parts, respectively, PHP, webserver, web browser, can be through the program code or configuration file to do real-time output, relatively background is controllable, but the foreground different browser buffering mechanism is different, there is no in-depth study. My solution is to allow non-real-time output.

One requirement to allow non-real-time output is that the program does not jump after processing the popup window. As follows:

<?phpecho "<script> if (Confirm (' Please select Jump page, is jump to yes.html no jump to no.html? ') location.href= ' yes.html '; else location.href= ' no.html '; </script> "; The following hearder parts are not allowed to join. Header (' location:http://www.baidu.com ');?>

Summary: The above is the entire content of this article, I hope to be able to help you learn.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.