简体   繁体   English

当我在php中使用递归时,jQuery ajax无法正常工作

[英]jquery ajax doesn't work when I use recursion with php

I have a problem using ajax (jquery) and recursion. 我在使用ajax(jquery)和递归时遇到问题。 I call a php script which contains a recursive function. 我叫一个包含递归函数的php脚本。 I don't know what's happening but I got this error everytime I call the $ajax function: 我不知道发生了什么,但是每次调用$ ajax函数时,都会出现此错误:

POST **myURL** 500 (Internal Server Error)
f.support.ajax.f.ajaxTransport.send  jquery.min.js:4
f.extend.ajax                        jquery.min.js:4
$.ajax                               jquery.validate.js:1068
myfunction                           file.php:216
(anonymous function)                 file.php:1
onclick

You should check your server logs to see what error is happening. 您应该检查服务器日志以查看发生了什么错误。 Whenever you get a 500 error, it means that your server did receive data from the browser, but something went wrong in the server code. 只要出现500错误,就意味着您的服务器确实从浏览器接收到数据,但是服务器代码出了点问题。 In other words, the problem isn't something in the browser code (ie it isn't jQuery/Javascript), so take a look at the server logs to see what's happening there. 换句话说,问题不是浏览器代码中的问题(即不是jQuery / Javascript),因此请查看服务器日志以了解发生了什么。

I fixed my script, I just want to recommend everyone "BACK TO BASICS". 我已修复脚本,我只想向大家推荐“回到基础”。 I spent 4 hours trying to fix it (I thought it was a recursion problem) and finally I found the mistake: it was a syntax problem in my php script. 我花了4个小时尝试修复它(我认为这是递归问题),最后我发现了错误:这是我的php脚本中的语法问题

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

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