Application scenarios:
During the WeChat authorization login process, users need to confirm, so this requirement is derived;
The reason why the corresponding logic is not placed on the front end is that this part of the logic is a functional business, so it is placed on the back end for convenient unified management.
Solution:
Use php to echo the JavaScript script, and the point you need to pay attention to here is the buffer.
There should be three parts of the buffer, namely php, webserver, and web browser. Real-time output can be achieved through program code or configuration files. Relatively speaking, the background is controllable, but the buffering mechanisms of different browsers in the front desk are different, so there is no in-depth research here. My solution is to allow non-real-time output.
One requirement for allowing non-real-time output is that the program does not jump after processing pop-ups. as follows:
<?php echo "<script> if(confirm( 'Please select Jump page, is it jump to? Does it jump to? ')) ='';else =''; </script>"; //The following hearer part cannot be added.//header('location:'); ?>
The above is the implementation method of the PHP control front-end pop-up dialog box introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply you in time. Thank you very much for your support for my website!