开发者

jQuery clone() Meta Title / document.title

开发者 https://www.devze.com 2023-03-14 00:38 出处:网络
Can one use jQuery to clone() a meta title?Basically I am trying to grab the Meta Tag Title and put it at the end of some words such 开发者_运维知识库as \"Related Products for...\", \"Accessories for.

Can one use jQuery to clone() a meta title? Basically I am trying to grab the Meta Tag Title and put it at the end of some words such 开发者_运维知识库as "Related Products for...", "Accessories for...". Below doesn't work but is in for example.

ie:

$('document.title').clone().appendTo('#similar, #suggested');


If you're just interested in appending the string, why not just use document.title?

$('#similar, #suggested').append( document.title );

Example: http://jsfiddle.net/Uyfae/


Try getting the value this way

$("head title").text();
0

精彩评论

暂无评论...
验证码 换一张
取 消