前几天做了一个简单的成功提示页面!
有需要的可以拿去用,写的不好 欢迎指正!~~
因为工程是在CI下面做的,url 自己用的话需要改正下函数!site_url() 这个函数式CI框架的
<html> <head> <meta charset="utf-8" /> <title>操作成功!</title> <style type="text/css"> .success_msg{ border: 1px solid #adceff; auto; height: 100px; background: #00b7ee; padding: 10px; font-size: 20px; border-radius: 4px; line-height: 100px; } </style> </head> <div class="success_msg"> <?php echo $msg?>,<span id="second" >3</span>秒钟后跳转! </div> <?php if(isset($url)): ?> <meta http-equiv="refresh" content="3; url=<?php echo site_url($url)?>"> <?php else:?> <meta http-equiv="refresh" content="3; url=<?php echo $_SERVER['HTTP_REFERER'];?>"> <?php endif?> <script type="text/javascript"> //倒计时 setInterval("clock()", 1000); function clock() { var span = document.getElementById('second'); var num = span.innerHTML; if(num != 0) { num--; span.innerHTML = num; } }; </script> </html>