我正在使用 phpdevshell(使用最新的 jQuery)创建一个应用程序。
现在,在我看不到任何原因的情况下,jQuery 开始请求一个以“undefined”结尾的 url,但该 url 不存在并导致 404。
它会查找以下网址:http://localhost/mysite/undefined
我已经找到了执行此操作的 jQuery 部分(从第 7866 行开始):
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null );
知道为什么会发生这种情况吗?谢谢。
最佳答案
看起来您正在使用返回 undefined variable 构建一个网址。即:var url = "http://localhost/mysite/ "+ 变量;其中变量未定义。
关于jQuery 请求未定义的 url(与 phpdevshell 一起使用),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7228250/