when I use $("#main").append( $("main",xml).children() );

I get the following:

[Exception... "Could not convert _javascript_ argument arg 0 [nsIDOMHTMLDivElement.appendChild]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://ss29/_work/sharkevader.com/v2/assets/js/jquery-1.0.pack.js :: anonymous :: line 9" data: no]

the other suggested approach

puts the data in but removes alot of the formating and disables links - quite odd not something I expected

any suggests




John Resig 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