I will try this after some sleep. thanks

though I am trying to replace the content in main, the aim is to replace
content within main with new content, effectivly changing the content of the page
users without JS reload the entire page JS enabled user load the new content in the
main div in place of the existing (not append - which is what you code seems to be)

I have had it working with just loading content from html files, I am now trying to extend
the set up to change the title and main content, then later ge it to work with slideUp & Down
(In the past I have had this working too, but it was buggy) then I want to be able to run js
code from the script node of the xml file.

perhaps this may not be doable? perhaps someone has a better approach (I have alternatives in mind,
this is the prefered)

much appreciated for you responses & advice, will try some more tommorrow

many thankx Sam

On 8/26/06, John Resig <[EMAIL PROTECTED]> wrote:
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/

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

Reply via email to