Friday, March 25, 2011

[PHP : is_writeable — Alias of is_writable()] is this a joke?

I just saw this function in the php.net manual (here) read it and tell me what do you think??

is_writeable

 (PHP 4, PHP 5)
is_writeable Alias of is_writable()

Sunday, February 13, 2011

The favicon appears briefly, then it disappears [Bug firefox]

Firefox have a weird bug related to the change of location.hash value, when you change this value the favicon disappears, I've spent a whole day searching how to fix this, the solution is simple all you have to do is to remove the favicon link then set it again after any change of the location.hash value.
Here’s the jQuery function from  http://kilianvalkhof.com/2010/javascript/the-case-of-the-disappearing-favicon/:


function setFavicon() {
  var link = $('link[type=image/x-icon]').remove().attr("href");
  $('<link href="'+ link +'" rel="shortcut icon" type="image/x-icon" />').appendTo('head');
}
and add setFavicon();  after any location.hash=url;


Based on the second comment bellow 



1- You should use quotes in the attribute selector like follow to make it work with new version of JQuery:

$('link[type="image/x-icon"]').remove().attr("href");

2- It's better to test on the rel attribute instead of testing on the type attribute because firstly a Favicon is not necessarily of type ico
and secondly if we follow the HTML standard (http://en.wikipedia.org/wiki/Favicon) a favicon is known by the rel="icon" attribute value:

$('link[rel*="icon"]').remove().attr("href");