views:

22

answers:

0

I`ve to make some examples for javascript, they are not really usable. This one is interesting - it works on Chrome (and other using webkit), Safari. So can someone sujest me any reason why it is not working?!?! One possible explanation is that the other browsers does not read the meta tags after the page is loaded, or does not read new added ones.

   if (document.createElement) {
   var meta = document.createElement('meta');
   var metaContent = '2; URL=http://localhost/new.html'; 
   meta.setAttribute('http-equiv', 'refresh');
   meta.setAttribute( 'content', metaContent );
   document.getElementsByTagName('head')[0].appendChild(meta);
   }