尝试连续2天解决问题。 我的html页面上只有这个脚本:
function show()
{
$.ajax({
url: "index.py",
cache: false,
contentType: "application/x-www-form-urlencoded;charset=windows-1251",
success: function(html){
$("#content").html(html);
}
});
}
function parse()
{
$.ajax({
url: "parser.py",
cache: false,
});
}
setInterval(show(),1000);
setInterval(parse(),10000);
</script>
它已通过uWSGI + nginx部署在VPS上。 问题是:在服务器上,当发送带有加载页面的Ajax请求(index.py,parser.py)时,它会毫无延迟地调用所有js脚本(包括
中的bootstrap和jquery)again and again。 但是在本地python http cgi服务器上,它可以正常工作。 可能是由于wsgi.py内容引起的吗?def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/html')])
return '''%ENTIRE HTML CODE OF THE PAGE%'''