Javascript无法运行窗体的幻灯片效果

Javascript无法运行窗体的幻灯片效果,javascript,php,html,Javascript,Php,Html,希望有人能帮我解决我遇到的问题。从另一页调用下拉表单时,我无法在该表单上运行幻灯片功能 我有一个admin.php页面,其中包含一个isAdmin.php文件,用于检查用户是否是管理员用户。如果没有,它会将它们重定向到index.php页面。然后我想调用我的slide函数,以便登录表单向下滑动到视图中,但命令不起作用 代码是 伊萨明: if(!isAdmin()) { header('Location: ../index.php?status=

希望有人能帮我解决我遇到的问题。从另一页调用下拉表单时,我无法在该表单上运行幻灯片功能

我有一个admin.php页面,其中包含一个isAdmin.php文件,用于检查用户是否是管理员用户。如果没有,它会将它们重定向到index.php页面。然后我想调用我的slide函数,以便登录表单向下滑动到视图中,但命令不起作用

代码是

伊萨明:

if(!isAdmin())
          {
                header('Location: ../index.php?status=3'); 
                //Login page should slide down for user to see the status message but function is not working correctly
                echo '<script>  $(document).ready(function (){ $("div#panel").slideDown("slow"); });</script> ';
           }
(如果我明白的话)。重定向后删除回声:

 if(!isAdmin()) {
            header('Location: ../index.php?status=3'); 
            //Login page should slide down for user to see the status message but 
            exit;
 }
更改'index.php':

 <?php if ( (isset($_GET['status']) && ($_GET['status']=='3')):?>
   <script>  $(document).ready(function (){ $("div#panel").slideDown("slow"); });</script> 
 <? endif;?>

您需要页面上的脚本代码将它们重定向到。重定向正在发生,它甚至没有触及echo语句。@mikevoermans太傻了!非常感谢你。现在工作
 <?php if ( (isset($_GET['status']) && ($_GET['status']=='3')):?>
   <script>  $(document).ready(function (){ $("div#panel").slideDown("slow"); });</script> 
 <? endif;?>