Javascript nginx服务器的问题

Javascript nginx服务器的问题,javascript,php,nginx,Javascript,Php,Nginx,我有以下php代码: <html> <head> <script stype="text/javascript"> function ventanachat(){ var xmlHttp; if (window.XMLHttpRequest) { xmlHttp=new

我有以下php代码:

    <html>
    <head>
        <script stype="text/javascript">
            function ventanachat(){
                var xmlHttp;
                if (window.XMLHttpRequest)
                  {
                  xmlHttp=new XMLHttpRequest();
                  }
                else
                  {
                  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                  }
                  var fetch_unix_timestamp ="";
                    fetch_unix_timestamp = function()
                        {
                        return parseInt(new Date().getTime().toString().substring(0, 10))
                        }
                    var timestamp = fetch_unix_timestamp();
                xmlHttp.onreadystatechange=function(){
                        if(xmlHttp.readyState==4){
                            document.getElementById("ventanachat").innerHTML=xmlHttp.responseText;
                            setTimeout('ventanachat()',10);
                        }

                        }
                        xmlHttp.open("GET","db.php"+"?t="+timestamp,true);
                    xmlHttp.send(null);
            }
            window.onload = function startrefresh(){
                    setTimeout('ventanachat()',1000);
                }
        </script>
    </head>
    <body>
        <form action="insert.php" method="GET">
        <input type="text" name="mensaje" id="enviachat" >
            <input type="submit">
        </form>
        <div id="ventanachat" style="width:200px;height:200px;border:1px solid black;overflow:hidden;">
            <script type="text/javascript">
                ventanachat();
            </script>
        </div>
    </body>
</html>

函数ventanachat(){
var-xmlHttp;
if(window.XMLHttpRequest)
{
xmlHttp=新的XMLHttpRequest();
}
其他的
{
xmlHttp=新的ActiveXObject(“Microsoft.xmlHttp”);
}
var fetch_unix_timestamp=“”;
fetch_unix_timestamp=函数()
{
返回parseInt(新日期().getTime().toString().substring(0,10))
}
var timestamp=fetch_unix_timestamp();
xmlHttp.onreadystatechange=函数(){
if(xmlHttp.readyState==4){
document.getElementById(“ventanachat”).innerHTML=xmlHttp.responseText;
setTimeout('ventanachat()',10);
}
}
open(“GET”,“db.php”+”?t=“+时间戳,true);
xmlHttp.send(空);
}
window.onload=函数startrefresh(){
setTimeout('ventanachat()',1000);
}
ventanachat();
这是一个非常基本的聊天页面,每1秒更新一次。(insert.php和db.php文件只是咨询文件,很好)

它在Apache中工作得非常完美,但Nginx在我身上不起作用。为什么?


(我会说西班牙语,如果拼错了,很抱歉。请使用翻译)。谢谢

您是否尝试查看回复?nginx可能会抛出一些错误