radish Posted June 30, 2011 Share Posted June 30, 2011 Hey all.I recently posted a problem I was having with loading XML using javascript/Jquery as DOM elements into my website dynamically.Now the page is loading my XML content fine but for some reason it isn't treating the nodes as html nodes.my XML is laid out theoretically like this <page> <section> <h2>lorem ipsum</h2> <p>lorem ipsum</p> </section></page> I am using html5 elements and they are showing up properly in firebug when i check the document <div id="main"> <section> <h2>lorem ipsum</h2> <p>lorem ipsum</p> <section></div> However my problem is that objects that are cloned using the .clone() method in my code won't have the default browser css applied to them.instead i have to hard code the styling in css for every object I clone in order for that object to have any css.is there any way I can apply the default css to these DOM objects without hard coding the css for every single element that i load dynamically?this is the code i'm using to clone() the XML objects. function loadPage(pageName) { // TESTING TO GET XML CONTENT $("div#main").append( $(XML_DOC).find("page#" + pageName).children().clone(true) );} Link to comment Share on other sites More sharing options...
jeffman Posted June 30, 2011 Share Posted June 30, 2011 What does the CSS look like? Link to comment Share on other sites More sharing options...
radish Posted July 1, 2011 Author Share Posted July 1, 2011 This is a legacy page I created that my website will default too in case javascript or xml don't work.This is how the content is supposed to lookthis is how it shows up when using .clone() from an XML object. Link to comment Share on other sites More sharing options...
radish Posted July 4, 2011 Author Share Posted July 4, 2011 This is a legacy page I created that my website will default too in case javascript or xml don't work.This is how the content is supposed to lookthis is how it shows up when using .clone() from an XML object.bump anyone any ideas? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.