문제

I would like to know how to set the page title by all means. I currently know two ways only :

<title>xxxxx</title>

And

<meta name="title" content="xxxxx" />

Is there more ?

The reason why i need to know that is because i have to create an application that reads the page title from a webpage so it must handle all cases.

도움이 되었습니까?

해결책

javascript can change it. when load is completed, so actual title might not be the one written first time in html

$(document).ready(function ()
{
    document.title = "xxxxxxxx";
});

다른 팁

The only real way to set the title is using:

<title></title>

However, some sites might also have Opengraph, Dublin core or Schema tags.

As the title element is required as part of HTML, I would use that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top