Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery requests undefined url (used with phpdevshell)

Tags:

jquery

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

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

It looks for this url: http://localhost/mysite/undefined

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.

like image 384
CodeVirtuoso Avatar asked Dec 05 '25 01:12

CodeVirtuoso


2 Answers

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.

like image 179
RobotRock Avatar answered Dec 06 '25 16:12

RobotRock


Try puting return false at the end of your function. May be it is propagating for another event.

like image 36
Jayantha Lal Sirisena Avatar answered Dec 06 '25 16:12

Jayantha Lal Sirisena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!