Hi
Thanx for your post.
Your script works and I see the meta tags including the new one are written on the page yet the new tag is not in the <head>

This happened to me with the previous examples as well. The new tag is added to the <head> object child array but is not added into the page..

Is there a pre-document-init event in js?
Maybe the reason is that when the script is parsed the head has already been loaded..??

BTW the script writes in ff yet ie has a syntax error..

Philip M

03-14-2009, 09:50 AM

Hi
Maybe the reason is that when the script is parsed the head has already been loaded..??

I guess that is it. And is there not possibly a security aspect?

freedom_razor

03-14-2009, 12:48 PM

Code I posted didn't throw any errors in IE7. But it wasn't working well in IE either, because NAME attribute wasn't included in new META tag in IE.
I've corrected this now, and you can see that the new META tag is in HEAD section:

If you hoping to see that META in source code of the page you'll have to open a new document and fill it with contents of the page+that new META tag. Usually, if page is modified client-side, the changes aren't reflected in the source code you view with your browser, though they are applied to the document.

Can I ask you what possible use you see for adding META tags client-side?

Actinia

03-14-2009, 12:56 PM

I tried this in FF using the Web Developer toolbar. This lets you view the generated code (View Source, View Generated Code), which indeed shows the generated meta tag just before the closing </head>. The Developer Toolbar in IE7 also shows it.

John

safhac

03-14-2009, 09:39 PM

Thanx freedom_razor

The script is working perfectly both in IE and FF

I can see it with firebug but not in source..

I wanted to index my video sharing blog in google

Ive asked one of the blog developers and he said thats impossible

but if i can get it to work using script then fine

so the script you wrote works but google doesnt verify it for indexing

I have to find another way..

freedom_razor

03-14-2009, 09:49 PM

What do you mean, your blog doesn't come up at all? How old is the domain?

Also, Javascript is a client-side technology, it is not going to help you at all with Google. It works in your browser. Bots reach documents on the server but usually don't execute Javascript in them.

Why don't you just put META in the source? You have no access to it?

safhac

03-15-2009, 08:49 AM

no i dont

if i did then there weer no problem..

youre right i got to have server side code to add it with script thats why the jscript worked in the 1st example..