admin管理员组文章数量:1335371
I have a robust title for web-crawlers etc... L.A. Takedown // The Band - bla bla...
~ but for style - I want a cool looking page title. I want the favicon to be the LA logo...
I create a new title for the page... nerd alert
var newTitle = ' Takedown';
Then, inserting it like this...
document.title = newTitle;
Then I get this:
I am very pleased with this... but I would love a little space before the 'Takedown' string / which is something I should understand in general...
It seems like strings just do this: ( I mean... strip the space at the beginning and end)
But I can add and replace the spaces for markup... but the document
/ browser tab isn't down with that...
So, why is this string having it's spaces stripped... '__Takedown' - and how can I force a space in there... ??? - in a non-markup situation?
Here is the CodePen breakdown of the ideas so far... and @moogs idea works in theory --- but the tab still doesn't reflect even though the spaces appear in the head
as seen here ->
If your answer is "the space doesn't matter - it's fine how it is..." or something like that.. just save yourself some time and don't reply. This is just an example.
This is what I want to happen...
I have a robust title for web-crawlers etc... L.A. Takedown // The Band - bla bla...
~ but for style - I want a cool looking page title. I want the favicon to be the LA logo...
I create a new title for the page... nerd alert
var newTitle = ' Takedown';
Then, inserting it like this...
document.title = newTitle;
Then I get this:
I am very pleased with this... but I would love a little space before the 'Takedown' string / which is something I should understand in general...
It seems like strings just do this: http://codepen.io/sheriffderek/pen/YXxyqQ ( I mean... strip the space at the beginning and end)
But I can add and replace the spaces for markup... but the document
/ browser tab isn't down with that...
So, why is this string having it's spaces stripped... '__Takedown' - and how can I force a space in there... ??? - in a non-markup situation?
Here is the CodePen breakdown of the ideas so far... and @moogs idea works in theory --- but the tab still doesn't reflect even though the spaces appear in the head
as seen here ->
If your answer is "the space doesn't matter - it's fine how it is..." or something like that.. just save yourself some time and don't reply. This is just an example.
This is what I want to happen...
- One approach to do this is to have the blank space in your icon file. – Saeed Hamed Commented Jun 14, 2015 at 19:15
- 1 @SaeedHamed - That is an approach... but given that I only have a square to work with, and the logo is already wider than it is tall... it would have to bee smaller... and - this is all about being a perfectionist... and more about the concept and general understanding of the browser tab limitations - than just making it work on this one site. I want the favicon as big as possible. – sheriffderek Commented Jun 14, 2015 at 19:58
2 Answers
Reset to default 11Looks like browsers trim leading white space characters, but the unicode 205f medium mathematical space character seems to work:
document.title = '\u205f Takedown';
Probably the option according to me would be to use
.
本文标签: javascriptAdd a space to the browsertab titleStack Overflow
版权声明:本文标题:javascript - Add a space to the browser-tab title - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742243821a2439003.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论