jQuery请求未定义的url(与phpdevshell一起使用) [英] jQuery requests undefined url (used with phpdevshell)

查看:107
本文介绍了jQuery请求未定义的url(与phpdevshell一起使用)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phpdevshell(使用最新的jQuery)创建一个应用程序。

I'm creating an app using phpdevshell (which uses latest jQuery).

现在我没有任何理由可以看到,jQuery开始请求以undefined结尾的url 这不存在并导致404.

Now without any reason visible to me, jQuery started requesting an url ending with "undefined" which doesn't exist and causes 404.

它寻找这个网址: http:// localhost / mysite / undefined

我找到了执行此操作的jQuery部分(从第7866行开始):

I've located the part of jQuery that does this (starting at line 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 );

知道为什么会这样吗?谢谢。

Any idea why this happens? Thanks.

推荐答案

看起来你正在构建一个带有返回undefined的变量的url。即:var url = http:// localhost / mysite / +变量;变量未定义的地方。

It looks like you're building an url with a variable that returns undefined. Ie: var url = " http://localhost/mysite/" + variable; where variable is undefined.

这篇关于jQuery请求未定义的url(与phpdevshell一起使用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆