Sam -

Try doing this:
$("main",xml).children().appendTo("#main");

or this:
$("#main").append( $("main",xml).children() );

I think they may get you the effect that you desire. This is with the
(soon to be) jQuery 1.0:
http://jquery.com/src/jquery-svn.js

--John

On 8/25/06, Sam Sherlock <[EMAIL PROTECTED]> wrote:
> .text works if you put the HTML in cdata.
>
> though I have some odd display issues, or am I still going wrong??
>
>
> On 8/26/06, Sam Sherlock < [EMAIL PROTECTED]> wrote:
> >
> > I have tried that but no joy, when I dump the mark up to the console
> >
> > var newContent = "";
> > ...
> > console.info('    main from xml source: ' + newContent);
> >
> >
> > main from xml source: undefined
> >
> > what am I doing wrong??
> >
> >
> >
> >
> > On 8/26/06, Jonathan Howard < [EMAIL PROTECTED]> wrote:
> > >
> > >
> > > Try:
> > >
> > > $("main",xml).html()
> > >
> > > instead of:
> > >
> > > $("main",xml).text()
> > >
> > >
> > >
> > > On 8/25/06, Sam Sherlock < [EMAIL PROTECTED]> wrote:
> > >
> > > >
> > >
> > > the dynamic xml source creates a structure along the following lines
> > >
> > > <content>
> > >    <title>my title</title>
> > >    <main>
> > >        <p>about</p>
> > >    </main>
> > >    <script>
> > >
> > >    </script>
> > > </content>
> > >
> > >
> > > the jquery code that I am using to take load the xml source and take the
> > > content
> > >
> > >
> > >
> $.get("./content/?id="+htmlDoc,function(xml){
> > >
> > >                    var innerHeight = 0;
> > >
> > >                    // however this return the text stripped of mark up
> > >                    alert( $("main",xml).text() );
> > >
> > >                    //  i need to retain the mark and place it in my
> > > main div
> > >
> $("div#main").html($("main",xml).text());
> > >
> > >                    innerHeight =
> > > document.getElementById('innerMain').offsetHeight;
> > >
> > >                    $("div#main").css({height: innerHeight+"px"});
> > >                    $("div#content").css({height: innerHeight+"px"});
> > >
> > >                    //
> $("div#main").slideDown("slow");
> > >
> > >                    //    console.info("new height " + innerHeight);
> > >                    init();
> > >                });
> > >
> > >
> > > is there a way to do this??

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to