i am working for a php application using codeigniter framework. i have to create a facebook page share link. for that i am trying to set meta tags dynamically.
i have to set Title, Description and Image Url dynamically.
i am using following code to set meta tag in head section
<meta property="og:image" content="http://some path/11.jpg"/>
<meta property="og:image:secure_url" content="http://somepath/callHealthCondDesc?id=1" />
<meta property="og:title" content="TITLE" />
<meta property="og:description" content="DESCRIPTION" />
after that setting meta tag dynamically in ready section
$(this).ready(function() {
$('meta[name=og\\:title]').attr('content', 'new title');
$('meta[name=og\\:description]').attr('content', 'new description');
$('meta[name=og\\:image]').attr('content', 'http://new image url');
}
but it is not constructing the page dynamically with new parameter.
i have checked some similar post
but could not get the working solution for me.
i am not clear where i am doing mistake. please guide me for the issue