javascript - jQuery read title with $.get page -


i title witch included in other page (on same domain).

on moment, following code isn't working:

$.get("/example.html", function(html){     alert($(html).attr('title')); }); 

content of example.html page is:

<html>   <head>     <title>foo</title>   </head>   ... </html> 

you can use filter() @ context filter out title tag,

alert($(html).filter("title").text()); 

and use .text() extract text content.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -