Xampp 分析错误语法错误,意外';类型';(T_字符串)

Xampp 分析错误语法错误,意外';类型';(T_字符串),xampp,notepad++,Xampp,Notepad++,我的php中有这个 echo "<script type ='text/javascript'> function delayer(){ window.location = 'peoplelist.html' } </script>"; echo” 函数延迟器(){ window.location='peoplelist.html' } "; 但是,计算机会回复我“解析错误:语法错误,意外的”类型“(T_字符串)第17行,有什么问题吗?尝试添加一个

我的php中有这个

echo "<script type ='text/javascript'>
function delayer(){
    window.location = 'peoplelist.html'
}
</script>";   
echo”
函数延迟器(){
window.location='peoplelist.html'
}
";   

但是,计算机会回复我“解析错误:语法错误,意外的”类型“(T_字符串)第17行,有什么问题吗?

尝试添加一个;到JS函数中文本的末尾

<?php
echo "function delayer(){ window.location = 'peoplelist.html'; }";
?>

编辑后,现在的错误是解析错误:语法错误,第17行出现意外的“函数”(T_function),我已经尝试了我的上述代码,它工作正常,一定是代码的另一部分出了问题,你能告诉我第17行是什么吗?echo“function delayer()