2

I've got a little problem with the favicon on my website. It works on every site, but the favicon disappears on the page with a included portfolio.

It's a filterable portfolio, so I think there is a problem with the domain maybe, because when the site laoded the url is getting at the end an id, called #all (to show all portfolio items).

I'm pleased about every help. Thanks a lot.

1 Answers1

1

Ok, I checked your website and tried deactivating javascript and the favicon showed up. So, my hypothesis is that the hash (#all) somehow messes up the favicon, maybe it's related to the base tag you use as I never had any problem with favicons.

My solution would be to try using an absolute path for your favicon: http://example.com/images/favicon.ico instead of using the base tag.

I hope it works as I can't say for sure, I don't usually use the base tag.

Solution using the 2 links in the comment

$(window).bind('hashchange', function() {
  var link = $('link[rel=shortcut icon]').remove().attr("href");
  $('<link href="'+ link +'" rel="shortcut icon" />').appendTo('head');
});
nebulousGirl
  • 1,364
  • 2
  • 13
  • 23
  • Thanks. I tried to do an absolute path, but this doesn't work. –  Jun 01 '12 at 17:44
  • I found this link that could help you: http://kilianvalkhof.com/2010/javascript/the-case-of-the-disappearing-favicon/. You could combine it with this: http://stackoverflow.com/questions/680785/on-window-location-hash-change – nebulousGirl Jun 01 '12 at 18:30
  • I tried the solution of kilianvalkhof before, but the funny thing is it shows short the icon and than it disappears... –  Jun 02 '12 at 09:25
  • Have you tried with the javascript listener on the hash change that I added to my answer? – nebulousGirl Jun 02 '12 at 12:51