简体   繁体   English

Ajax无法到达帖子页面

[英]Ajax cannot reach the post page

I've been spending hours trying to figure out what is wrong with this code, i found out that i cannot reach the updateuser.php file, its on the same directory, the filenames are corret, is there something wrong with this code: 我花了数小时试图弄清楚这段代码出了什么问题,我发现我无法到达updateuser.php文件,它在同一目录中,文件名是corret,这段代码有什么问题:

<script>
 function updateuseracc(form, password)
{   
var p = document.createElement("input");

form.appendChild(p);
p.name="p";
p.type="hidden";
p.value=hex_sha512(password.value);
password.value="";

var useremail=$("#curemail").val();


$.post('updateuser.php',{email:useremail,p:p}).done(function(data){
    alert(data);
    });


}
 </script>

Bring up development tools with F12 on Google Chrome, then go to 'Network' option and check if after calling the script a 500 header page is returned. 在Google Chrome上使用F12调出开发工具,然后转到“网络”选项,并检查在调用脚本后是否返回了500标题页。 You can check this at the list of resources called that you will see at development bar. 您可以在开发栏中看到的称为资源的列表中进行检查。

If so, you will know that you are not referring to the script correctly, also you will get information from the parsed URL so you can guess how can you set the path to updateuser.php. 如果是这样,您将知道您未正确引用该脚本,而且还将从解析的URL获取信息,因此您可以猜测如何设置updateuser.php的路径。

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

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