Bug 54783 - "Failed to load resource" in click handler; blocks image loading and XHR
: "Failed to load resource" in click handler; blocks image loading and XHR
Status: RESOLVED WORKSFORME
Product: WebKit
Classification: Unclassified
Component: Page Loading
: 528+ (Nightly build)
: PC Windows Vista
: P2 Major
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-18 17:00 PST by Anthon Pang
Modified: 2014-03-10 16:23 PDT (History)
2 users (show)

See Also:


Attachments
Example (963 bytes, text/html)
2011-02-18 17:01 PST, Anthon Pang
no flags Details
Another example with beforeUnload handler (1.53 KB, text/html)
2011-02-19 08:37 PST, Anthon Pang
no flags Details
Updated example with beforeunload handler. (1.53 KB, text/html)
2011-02-19 08:51 PST, Anthon Pang
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthon Pang 2011-02-18 17:00:17 PST
The error appears in Web Inspector and no corresponding HTTP request appears in the web server logs.  I stepped through the execution in Safari 5.0.3, and the click handler is triggered.

This is a significant issue that impacts major apps like Google Analytics.  The only workaround appears to be setting the anchor's target attribute so that the page loads in a new window, e.g., target="_blank".  Opening a new window disrupts the user experience and is frowned upon.

References:
- Safari 4 Event Tracking on a Download and External Links Not Working
  http://www.google.com/support/forum/p/Google%20Analytics/thread?tid=42311d8d5f74f239&hl=en
-__utm.gif Failed to load resource in Webkit when tracking clicks with Event Listeners 
  http://www.google.com/support/forum/p/Google%20Analytics/thread?tid=19d16348ea784a25&hl=en

Editorial note:  this could be a duplicate of bug:25359 but that bug is light on details; also, the symptoms are similar to to bug:46491 but is triggered differently.
Comment 1 Anthon Pang 2011-02-18 17:01:29 PST
Created attachment 83037 [details]
Example
Comment 2 Alexey Proskuryakov 2011-02-18 20:21:46 PST
Did you test with nightly builds from <http://nightly.webkit.org>? I think that some of these ping mechanisms should work now.
Comment 3 Anthon Pang 2011-02-19 08:37:15 PST
Created attachment 83075 [details]
Another example with beforeUnload handler

Added a beforeUnload handler to the example to introduce a delay, in case the ping request was being interrupted by the default action due to some timing issue.
Comment 4 Anthon Pang 2011-02-19 08:41:31 PST
The only difference with the latest nightly (r78800) is that Web Inspector  went from:

    Failed to load resource.

to:

    GET http://url-of-ping-request undefined (undefined)
Comment 5 Anthon Pang 2011-02-19 08:51:10 PST
Created attachment 83076 [details]
Updated example with beforeunload handler.
Comment 6 Brian Burg 2014-03-10 16:23:32 PDT
Please re-open if this is still an issue in nightly builds.