Skip to main content

Bug Tracker

Side navigation

#7969 closed bug (fixed)

Opened January 14, 2011 06:18AM UTC

Closed January 14, 2011 10:56PM UTC

Last modified January 16, 2011 04:02AM UTC

$.get() returns "success" when the request fails by timeout

Reported by: mappy Owned by:
Priority: low Milestone: 1.5
Component: ajax Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

When $.get() is called to an address where no server is running - e.g. http://127.0.0.1:82 - the request succeeds, returning 'success' as the second callback argument

Expected behavior:

Request fails, does not return 'success' to the callback.

Steps to reproduce:

1. Save the code from http://pastebin.com/RfXmekB7 as a local .htm file

2. Open the .htm in a browser and watch the javascript console

3. Status appears as 'success', despite no server existing at 127.0.0.1:82

Attachments (0)
Change History (3)

Changed January 14, 2011 06:20AM UTC by anonymous comment:1

Relevant chat log from #jquery on irc.freenode.org

<mappy> could anyone grab http://pastebin.com/RfXmekB7, save and run it locally?
<Vorspire> mappy, use jsfiddle.net :)
<mappy> i tried, but the problem doesn't reproduce there owing to access control issues
<mappy> sorry
<Vorspire> ahh
<Vorspire> mappy, how is that address invalid?
<mappy> well, presumably there's no server running on it
<mappy> it should timeout and die
<alcuadrado> Loading the invalid address 'http://127.0.0.1:82/?'..
<alcuadrado> Status: success
<alcuadrado> Data:
<alcuadrado> you are right
<Vorspire> mappy; line 5974; "// The transfer is complete and the data is available, or the request timed out"
<Vorspire> so if it times out, it still returns true i guess
<mappy> ok : /
<mappy> seems like counterintuitive behaviour

Changed January 14, 2011 10:56PM UTC by jitter comment:2

component: unfiledajax
milestone: 1.next1.5
priority: undecidedlow
resolution: → fixed
status: newclosed

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

I used the code you provided on that pastebin. This was only reproducible using Firefox. Anyhow this has already been fixed and works as expected with the today released jQuery 1.5b1 version (which includes a major ajax rewrite)

Please verify with this http://pastebin.com/sk3mmEiG if it is indeed fixed for you also.

Changed January 16, 2011 04:02AM UTC by mappy comment:3

I've tested both scripts with Chrome 9 only. Changing to jQuery 1.5b1, as in your script, seems to make the inner .get function never execute. No further lines are shown after ``Loading the invalid address 'http://127.0.0.1:82/?'..''.

This behaviour is fine by me, thanks for your response.