Opened 12 years ago
Closed 12 years ago
#7763 closed bug (plugin)
Script transport doesn't handle errors
Reported by: | iliakan | Owned by: | jaubourg |
---|---|---|---|
Priority: | low | Milestone: | 1.6 |
Component: | ajax | Version: | 1.4.4 |
Keywords: | Cc: | jaubourg | |
Blocked by: | Blocking: |
Description
Script transport handles successful onload only. I could add a partial error-handling to it which works except few IE subversions and Opera.
Is that needed?
Change History (11)
comment:1 Changed 12 years ago by
Component: | unfiled → ajax |
---|---|
Owner: | set to iliakan |
Priority: | undecided → low |
Status: | new → pending |
comment:2 Changed 12 years ago by
Cc: | jaubourg added |
---|
jaubourg is this what you talked about with [algo] on IRC? What was the outcome?
comment:3 Changed 12 years ago by
Ilia & I are currently investigating the issue which has more to do with jsonp error handling and being able to do that cross-browser with no sniffing involved.
Even if we manage to pull it off, the "hack" for IE (which consists in executing the code as a function -- don't ask) would fail with scripts that declare global variables without attaching them to the window object.
Yet we're investigating a solution for jsonp at least.
comment:4 follow-up: 5 Changed 12 years ago by
Status: | pending → new |
---|
The summary as I see it:
- Browser sniffing is going to be replaced by feature sniffing
- JSONP gets complete error handling
- Script gets partial error handling
As to the last point - I strongly believe that partial error handling is better than no handling at all, just because errors do occur. A developer needs to track them down somehow. So partial error handling is better than "consistent" not handling.
The usage pattern for catching errors will be "onerror" + timeout. Much better than just timeout.
Please comment if you see any potential problem with the points above..
comment:5 Changed 12 years ago by
Replying to iliakan:
The usage pattern for catching errors will be "onerror" + timeout. Much better than just timeout.
Please comment if you see any potential problem with the points above..
Reads as: IE/Opera users with a slow connection or slow servers are doomed. That prospective doesn't look good to me.
comment:6 Changed 12 years ago by
Yeah it's not ideal. But...if we can prescribe which situations can be reliably handled in IE/Opera then developers have a way to create reliable pages.
comment:7 Changed 12 years ago by
jitter: it's up to developer to set timeout or not. The point is, again, the error is to be handled.
There is nothing worse than just letting a user stare into "loading" screen for an hour.
At this moment, programmers have no way to catch errors besides timeout. We should give it to them. So they don't use timeout all the time.
Isn't that clear?
comment:8 Changed 12 years ago by
If this is a verified issue could someone please set this to open/assigned and give it a milestone?
comment:9 Changed 12 years ago by
Status: | new → pending |
---|
comment:10 Changed 12 years ago by
Owner: | changed from iliakan to jaubourg |
---|---|
Status: | pending → assigned |
I'll take ownership seeing as Ilia somehow disapeared. Not sure the best solution isn't simply a jsonp plugin seeing as detecting errors is only possible for jsonp and would mean duplicated script tag injection code (one for jsonp, another for script).
comment:11 Changed 12 years ago by
Resolution: | → plugin |
---|---|
Status: | assigned → closed |
Sounds like this is going to end up as a plugin? Correct me if I'm wrong, Julian.
Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket!
Additionally, test against the latest jQuery release and the jQuery 0 GIT version to ensure the issue still exists. Be Excellent to eachother!
I'm suspicious this may be related to #6060