I’m trying to $.load() some data from other page (foo.html). Say I want my current <title>Current</title> to be the same as foo’s title, <title>Foo</title>.
What I’m doing is:
$("title").load("foo.html title");
The problem is I get foo’s title with the <title> tag:
<title><title>Foo</title></title>
and it obviously doesn’t work.
How can I get only the text of foo’s title?
This feels like a hack but it works.
Even though this is a hack, I made a tiny plugin you can use.
Use it like this:
If you wanted to load into the
title, the text of another tag…