Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing metatags (DOM ready)
#1
Hi,

On a dynamical product page I want to change the metatags (SEO) with the actual product information.

I've made the following with jQuery but does this change make sense (for SEO) after DOM is ready? The page source is not showing the changed metatags, with Firebug it does.

Code:
$('meta[name=description]').attr('content', '<?php echo $description; ?>');
$('meta[name=keywords]').attr('content', '<?php echo $keywords; ?>');

... or ...

$('meta[name=description]').remove();
$('head').append( '<meta name="description" content="<?php echo $description; ?>">' );
    
$('meta[name=keywords]').remove();
$('head').append( '<meta name="keywords" content="<?php echo $keywords; ?>">' );

Is there a way (function) to change this after function get_header(); is started?

Regards, René
Reply


Messages In This Thread
Changing metatags (DOM ready) - by Rene - 2014-01-23, 20:21:45
RE: Changing metatags (DOM ready) - by Timbow - 2014-01-23, 21:26:03
RE: Changing metatags (DOM ready) - by Rene - 2014-01-23, 22:42:53
RE: Changing metatags (DOM ready) - by Carlos - 2014-01-24, 06:23:31
RE: Changing metatags (DOM ready) - by Rene - 2014-01-24, 19:28:30
RE: Changing metatags (DOM ready) - by Carlos - 2014-01-25, 00:47:13
RE: Changing metatags (DOM ready) - by shawn_a - 2014-01-25, 00:50:54
RE: Changing metatags (DOM ready) - by Rene - 2014-01-28, 23:49:01



Users browsing this thread: 1 Guest(s)