I load an html page into the body of the landing page through jquery and ajax. I need the <title>Page Title</title> from the uploaded document for the landing page.
I tried this but no luck:
$.ajax({ url: "test.htm", cache: false, dataType: "html", success: function(html){ $('#main-load').html(html); $('#greeting').append($(html).find('title').text()); } });
I also tried several other methods, but no luck. Any ideas?
Thanks!
EDIT: test.htm is a very simple document.
Example:
<html> <head> <title>Page Title</title> <style> .... </style> </head> <body> .... </body> </html>
source share