简体   繁体   English

Ajax jquery 和 php 问题

[英]Ajax jquery and php problem

I have a french website and it works flawlessly on my localhost it is made with php and javascript and html and mysql.我有一个法国网站,它在我的本地主机上完美运行,它是由 php 和 javascript 和 html 和 Z81C3B080DDEAD4E.

http://techtionary.comeze.com/game.php http://techtionary.comeze.com/game.php

This is the link这是链接

the signup works(ps if you enter any user name and password it will let you in)注册有效(ps,如果您输入任何用户名和密码,它将让您进入)

Then look at the page game.php然后看页面游戏.php

if you look at the source code you will all my ajax requests.如果您查看源代码,您将看到我所有的 ajax 请求。

This website was hacked together in one night as an overdue project so do not judge the coding style.这个网站作为一个过期项目在一夜之间被黑掉了,所以不要判断编码风格。

Just please could someone tell me why my ajax post requests are not working.请有人告诉我为什么我的 ajax 帖子请求不起作用。

Looking at it in firebug, your game.php file sends a request to maketable.php - but it looks for it on the localhost, rather than its location on the server.在 firebug 中查看它,您的game.php文件向maketable.php发送请求 - 但它在 localhost 上查找它,而不是在服务器上的位置。

Look at the request in firebug:查看firebug中的请求:

GET http://localhost:8888/school/maketable.php

localhost in your code本地主机在您的代码中

    setInterval(function(){ 
        $("#about").prepend("<div id='message'></div>");
        $("#message").load("http://localhost:8888/school/maketable.php");
    }, 3000);
    setInterval(function(){ 
        $("#points").load("score.php");

$("#message").load("http:// localhost:8888 /school/maketable.php"); $("#message").load("http:// localhost:8888 /school/maketable.php");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM