I'm trying to extract the page title of an external site by using a url.
You know how "document.title" returns the title of the page the JS is running on? I was wondering if I could say "'http://google.com'.title" (doesn't work) or something similar to get the title of another page.
UPDATE: I did some searching and apparently this can be done with JQuery. see http://www.google.com/search?q=jquery+extract+page+title. and if I understand correctly JQuery is kind of an extension of javascript and its supported in what I'm doing. so can someone post the JQuery code that can accomplish this?
this is the basic idea: there is an input box labled "url". And a button labled "Convert to page title" and the intention is that the value of the input box will change to the Title of the url given by the user (after they click on the button)
function getTitle(url) {
var title = [CODE HERE];
return title;
}
thank you!