I think you have to separate the selector otherwise it's just a hash:
$(".content").load("test.html #content");
http://docs.jquery.com/Ajax/load
On Apr 27, 5:14 pm, Charlie <[email protected]> wrote:
> $(".content").load("test.html#content");
> this will grab only the id content from test.html and load it , can refine
> this down to elements within #content as well
> example on jQuery site shows same [email protected]:Hello
> Michael, thanks for this. I got a error: > html.find is not a function Any
> idea? <script type='text/javascript'
> src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script>
> <script type="text/javascript"> $(document).ready(function(){ $.ajax({ url:
> "leistung.html", cache: false, success: function(html) { var loadCont =
> html.find('#cont'); $(".content").append(loadCont); } }); }); </script> On
> Apr 27, 5:07 pm, Michael Lawson<[email protected]>wrote:instead of
> $(".content").append(html); do var contentToAppend = html.find("#cont");
> $(".content").append(contentToAppend); cheers Michael Lawson Content Tools
> Developer, Global Solutions, ibm.com Phone: 1-828-355-5544 E-mail:
> [email protected]'Examine my teachings critically, as a gold assayer would
> test gold. If you find they make sense, conform to your experience, and don't
> harm yourself or others, only then should you accept them.' From:
> "[email protected]"<[email protected]>
> To: "jQuery
> (English)"<[email protected]>
> Date: 04/27/2009 11:03 AM
>
> Subject: [jQuery] ajax append problem
> Hello, im using this
> script to load a external site into my DOM. It works fine but i need just a
> part of this test.html. For example: I want to append just the div "#cont"
> from test.html How can i do that? <script type="text/javascript"> $.ajax({
> url: "test.html", cache: false, success: function(html){
> $(".content").append(html); }}); </script> Thanks for Help! graycol.gif <
> 1KViewDownload ecblank.gif < 1KViewDownload