Fallback

Nov 03 2010 Published by under MediaCreeper

I just figured out how to add some fault-protection, as sort of fallback, if loading of the badge would fail. By adding onerror="this.src='http://mediacreeper.se/image';" to the badge-code which is pasted into pages it makes the badge a little more fault-resilient.

I know, the onerror event isn’t supported everywhere but Firefox and for all I know, MSIE supports it. It breaks validation of XHTML 1.0 Strict.

Tags:

One response so far

  • Seppo says:

    This fallback causes an infinite loop (and high CPU usage) in Firefox with the RequestPolicy add-on installed and when cross-site requests to mediacreeper are not allowed.

    Only way to “fix” this error is to either disable JavaScript on each site using mediacreeper (which most times would break the site) or to allow cross-site requests to mediacreeper (which I don’t want to do.)

    So right now I’m going to add mediacreeper.com into my hosts file with IP 0.0.0.0 or 127.0.0.1 and then allow the domain in RequestPolicy, so that the inline onerror won’t trigger infinitely. I’m fed up with the thousands of errors in my logs.

Leave a Reply