Try this for the success parameter:

        success: function(html) {
            var $html = $(html);
            var title = $html.filter('title').text();
            alert(title);
        }

Basically, you have to use .filter() instead of .find();

Here's a demo page:

http://test.learningjquery.com/ajax-load.php


--Karl

____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Sep 23, 2008, at 9:19 PM, MindstormsKid wrote:




ricardobeat wrote:

1. I don't see the point in loading a full HTML page with ajax, you
could load snippets of HTML or XML data instead.

Well, In my case I need to...

ricardobeat wrote:

2. You can't have text directly inside <body>, they have to be inside
a block-level element. That's why getting a <div>'s content works.

Try doing $('body').load('test2.html') on the page and you'll see what
happens.

You can't?
Well, I did "$('body').load('test2.html')" and nothing happened. I also put the text in a <div> and it did the same thing both ways (results are up at
that URL).
--
View this message in context: 
http://www.nabble.com/Find%28%29-doesn%27t-want-to-find-anything-out-of-the-body-tp19632317s27240p19640232.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.


Reply via email to