Extracting page title using javascript
<p>I'm trying to extract the page title of an external site by using a url.</p>

<p>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.</p>

<p>UPDATE:
I did some searching and apparently this can be done with JQuery. see <a href="http://www.google.com/search?q=jquery+extract+page+title" rel="nofollow">http://www.google.com/search?q=jquery+extract+page+title</a>. 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?</p>

<p>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)</p>

<p><code>function getTitle(url) {</code></p>

<pre><code>    var title = [CODE HERE];
    return title;
</code></pre>

<p><code>}</code></p>

<p>thank you!</p>
