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.