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

后端 未结 18 823
后悔当初
后悔当初 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:38

    simple add and div atribute to each meta tag example

    
    
    
    

    now like normal div change for ex. n click

    Change Meta Tags
    

    function change tags with jQuery

    function changeTags(){
       $("#mtlink").attr("content","http://albup.com");
       $("#mtdesc").attr("content","music all the time");
       $("#mtkwrds").attr("content","mp3, download music, ");
    
    }
    

提交回复
热议问题