You’ll probably never see it unless you use Firebug or look at Apache raw access logs, but jquery.gritter causes 404 errors repeatedly.
The problem with 404′s is that they are like visiting relatives. They don’t go away unless you do something about it, and you usually can’t be bothered to do something about them – because it’s really not that bad.
Of course, sometimes it is. Especially if you get it on every page load. These errors are annoying and clutter your log, potentially hiding important ones. You also get 404 blindness – and you may miss the “real” 404 that your users see.
Still not convince – just think abot the extra half a second or so your users waste with every page load…
If you look at firebug’s console you’ll see something along the following:

Examining the request (in firebug or Apache access log) shows:
In firebug, you can also see the referer:

As you can clearly see (click on the image to see clearly…) – the referer of the GET request is the jquery.gritter.css file. This is strange right?
Well, css files can definitely issue GET requests. For example, they may try to load background images. This calls for a quick look into the css file itself:
position:relative;
margin:0 0 10px 0;
background:url('.'); /* ie7/8 fix */
}
This tries to set a background image on the wrapper div, so that it can solve a nasty IE7/8 positioning bug. However, this results in a GET request to the current directory – which happens to be the css directory. Naturally – this does not end well.
Luckily, the fix is easy. All you have to do is add a real background image. As long as you make it 1px by 1px (or completely transparent) – you’ll be fine and the 404′s will disappear:
position:relative;
margin:0 0 10px 0;
background:url('../img/blank.gif'); /* ie7/8 fix */
}
Look at your logs/firebug – all good now!
Popularity: 3% [?]
One Response to Getting 404 with jquery.gritter?
Leave a Reply Cancel reply
Recent Comments
- Medovarszki: This post saved my hair from falling out but yeah, I beat my head against the wall now too
- Shehryar: Probably the ebst spring web mvc tutorial I have read, explain everything in great detail. i loved it, this...
- armand: You do not resize the image. You just display it smaller using html tag attributes. It would be nice to...
- COTP: ** Just to clarify, in CakeErrorController.php (the copy in app/Controller/) public function beforeRender() {...
- COTP: For CakePHP 2.0+, you can copy lib/Cake/Controller/CakeErrorC ontroller.php to app/Controller/CakeErrorCon...
- Medovarszki: This post saved my hair from falling out but yeah, I beat my head against the wall now too
Categories
- Android (1)
- appengine (3)
- Be nice to your users (6)
- CakePHP (13)
- General (5)
- Googlemaps (3)
- Java (11)
- javaScript (4)
- jQuery (11)
- Seam (2)
- Security (4)
- Spring MVC (1)
- Spring Webflow (2)
- User Interface (5)
- Wordpress (2)
Archives
- January 2012 (2)
- December 2011 (1)
- July 2011 (2)
- June 2011 (4)
- May 2011 (1)
- December 2010 (3)
- November 2010 (1)
- August 2010 (2)
- July 2010 (2)
- June 2010 (4)
- May 2010 (4)
- April 2010 (5)
- March 2010 (3)

Thanks! This has been bugging me for an hour. It’s so obvious once you point it out!