开发者

Alternatives to document.title?

开发者 https://www.devze.com 2023-02-13 15:28 出处:网络
I\'m attempting to return the page title. Using document.title doesn\'t appear to be reliable. It\'s often returning the title of frames within a page and sometimes nothing depend开发者_开发百科ing on

I'm attempting to return the page title. Using document.title doesn't appear to be reliable. It's often returning the title of frames within a page and sometimes nothing depend开发者_开发百科ing on the web page. I'd like to return the title which appears at the top of the tab e.g Gmail - Inbox etc.. on a Gmail page. Is there any alternatives to document.title? I'm testing on Chrome.


Sounds like the problem is with frames. You could try top.document.title, which will give you the title of the topmost frame.

0

精彩评论

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