I'm setting document.title
with JavaScript, and I can't find a way to supply » (»
) without it appearing as literal text.
Here's my code:
document.title = 'Home » site.com';
If I use » ; in the title tag of the document it works great and displays correctly as », but it seems to be unescaping when I include it in document.title
.
Any ideas?
thanks!
The Stock Exchange of Thailand is open Monday through Friday from 10:00 am to 12:30 pm and 2:30 pm to 4:30 pm Indochina Time (GMT+07:00).
What is SETS? Stock Exchange Electronic Trading Service (SETS) is London Stock Exchange's flagship electronic order book, trading FTSE 100, FTSE 250, FTSE Small Cap Index constituents, Exchange Traded Funds (ETFs) and Exchange Traded Products (ETPs), plus other liquid AIM, Irish and London Standard-listed securities.
Founded on 30 April 1975, it is ASEAN's 2nd largest after Singapore and the world's 23rd by market capitalization at US$564 billion (both SET and mai) as of 9 May 2022.
document.title
takes the string as it is, so you can do this:
document.title = 'Home » site.com';
If you need to provide it as the entity name, you can set the innerHTML attribute. Here are two examples of how you can do it.
document.getElementsByTagName('title')[0].innerHTML = '»';
// or
document.querySelector('title').innerHTML = "»";
Try
document.title = 'Home \u00bb site.com';
Generally you can look up your special character at a site like this and then, once you know the numeric code, you can construct a Unicode escape sequence in your JavaScript string. Here, that character is code 187, which is "bb" in hex. JavaScript Unicode escapes look like "\u" followed by 4 hex digits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With