Having trouble using jQuery to set meta tag values

Posted by Zhami on Stack Overflow See other posts from Stack Overflow or by Zhami
Published on 2010-05-14T02:35:02Z Indexed on 2010/05/14 2:44 UTC
Read the original article Hit count: 360

Filed under:
|

I'm trying to set meta tags using jQuery (please don't reply that this doesn't make sense since search engines blah-blah-blah... I am loading invoking 3rd party Javascript functions that examine these vales, such as Tweetmeme and Facebook).

If I use:

 $('meta[name=some-name]').attr('content', 'some value');

it does work to set the value of an existing meta tag, but does not create a meta tag if such a named one does not exist.

If you have insight or experience with this, please reply...

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about meta-tag