Getting the title of a web page given the URL

javascript

Solution

You can't access this is the site is on a different domain. That would be a security violation of the same origin policy.

Otherwise, you could load the other web page into a hidden `iframe` and use this:

document.getElementById('myIframe').contentWindow.document.title;

Actually I semi-lied. It is a security violation to do this, but IE has a bug whereby you can access the content via VBScript. Not sure if this has been patched yet.

Problem

Is there any method that will return the title of the web page given its URL? I don't mean the title of the current page which can be gotten from doing `document.title`, I mean getting the title of another web page.

Original source

Related problems