Is it possible to use JavaScript to change the meta-tags of the page?

后端 未结 18 1061
后悔当初
后悔当初 2020-11-22 14:14

If I put a div in the head and display:none, than use JavaScript to display it, will this work?

Edit:

I have stuff loaded in AJAX. And as my AJAX changes the

18条回答
  •  抹茶落季
    2020-11-22 14:32

    have this in index

    
    

    have this in ajaxfiles og:type"og:title"og:description and og: image

    and add this also

    
    

    then add in js after the ajaxCall

    FB.XFBML.parse();
    

    Edit: You can then display the correct title and image to facebook in txt/php douments(mine are just named .php as extensions, but are more txt files). I then have the meta tags in these files, and the link back to index in every document, also a meta link in the index file for every subfile..

    if anyone knows a better way of doing this I would appreciate any additions :)

提交回复
热议问题