Jump to content

Recommended Posts

Hi all,

 

I have a favicon added to a global template in Yii, so the favicon is included in every page, and it also shows in every page. except in a few...

There are a few pages in the project that don't display the favicon despite having the exact same layout files as all the others...

 

part of the head tag of the template =>

  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="en" />
       <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <link rel="icon" type="image/x-icon" href="images/favicon.ico" />
    <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />

 

I've checked the source code and the header is exactly the same as all the other pages, with sometimes a few javascript includes more or less

if I edit the favicon value using firebug the icon "reappears" even if I restore the original source (so removing or adding a "/" before the href)

 

chrome always show the favicon, firefox doesn't (on a few pages).

 

What could be a reason for this problem? googling has led me nowhere...

 

If more info is needed, ask and i'll supply. unfortionatly the website I'm working on isn't public, so I can't share the links to the actual pages....

Link to comment
https://forums.phpfreaks.com/topic/269774-inconsistent-favicon/
Share on other sites

Hi, I can't give the url's atm, cause I'm not at my work, but I can tell you that adding or removing the leading '/' does nothing.

The page it mostly doesn't show the favicon is a page that uses a lot of drag & drop events, as well as a hash tag which defines what is currently shown.

(its a kind of calendar with drag/drop event adder and a "current month" tracing through the hash tag => http://www.example.com/some/calendar#2012-10-23)

I've just figured out that each time a ancher is added to the url, and the page is reloaded, that the favicon didn't show. so looking for that problem specific, I've found that it's an existing firefox issue.

 

I've managed to solve this issue by adding the following javascript code after setting or reading the hash tag.


$('link[type*=icon]').detach().appendTo('head');

Hopefully this'll be helpfull to others as well.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.