2
I am trying to change the value of meta tags with data coming from the database but they are not filled inside the tags. The value is recovered normally and displayed within the script when the view-source is activated but the content of the meta tag remains empty.
<script type="text/javascript">
$(function(){
$('meta[name="author"]').attr('content','Marcelo de Andrade');
$('meta[name="description"]').attr('content','zzzzzzzzz');
$('meta[name="keywords"]').attr('content','');
});
</script>
<meta name="author" content="" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta property="og:title" content=""/>
<meta property="og:url" content=""/>
<script type="text/javascript">
$(function(){
$('meta[name="author"]').attr('content','<?php echo $owner->name ?>');
$('meta[name="description"]').attr('content','<?php echo $group->elevatorpitch ?>');
$('meta[name="keywords"]').attr('content','<?php echo $group->tags ?>');
$('meta[property="og:title"]').attr('content','<?php echo $group->name ?>');
$('meta[property="og:url"]').attr('content','<?php echo ideas_url($group) ?>');
});
</script>
However, it’s still worth remembering that Google parses both Javascript and CSS to find out what happens on the page and to give relevance. Matt Cutts himself has already talked about it here: http://www.youtube.com/watch?v=B9BWbruCiDc
– Ronny Amarante
@Ronnyamarante yes, Google works over witchcraft.
;)
Pranks aside, I hadn’t seen this video yet, thanks for the info.=]
– Fabrício Matté
Thank you, guys!
– Marcelo de Andrade