"J1C" <ju********@yahoo.ca> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
How can I programatically add meta tags with javascript?
In browsers that support it:
var meta = document.createElement('meta');
meta.name = 'author';
meta.content = 'Your Name';
document.getElementsByTagName('head')[0].appendChild(meta);
However, since the META tag data is mostly for the benefit of search
engines, what does appending a META tag after the page is loaded buy
you? For example, the following doesn't work in IE:
var meta = document.createElement('meta');
meta.setAttribute('http-equiv', 'imagetoolbar');
meta.setAttribute('content', 'no');
document.getElementsByTagName('head')[0].appendChild(meta);
Even though <META HTTP-EQUIV="imagetoolbar" CONTENT="no"> does suppress
the image toolbar.
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq