Hi, I'm confused as to why you are trying to load XML into an iframe using AJAX. Why not just set src="atom.xml" and load the feed directly into the iframe?
Paul On Jun 9, 9:13 pm, barton <bartonphill...@gmail.com> wrote: > I have been trying to insert xml into an iframe. I can do it kinda. > The problem is the iframe has <html></html> tags and if the xml has > items that look like <head> tags like <title> etc they end up in the > head. For example I have a atom file that looks like this: > > <?xml version="1.0" encoding="UTF-8"?> > <feed version="0.3" xmlns="http://purl.org/atom/ns#"> > <title>Gmail - Inbox for bartonphill...@gmail.com</title> > <tagline>New messages in your Gmail Inbox</tagline> > <fullcount>4</fullcount> > <link rel="alternate" href="http://mail.google.com/mail" type="text/ > html" /> > <modified>2009-06-07T22:20:48Z</modified> > <entry> > <title>TORNADO WARNING from 9News CustomCast</title> > <summary>Severe Weather Bulletin Click here to get additional current > severe weather information This is ...</summary> > <link rel="alternate" href="http://mail.google.com/mail? > account_id=bartonphillips > %40gmail.com&message_id=121bc3ef3abda1f1&view=conv&extsrc=atom" > type="text/html" /> > <modified>2009-06-07T19:43:10Z</modified> > <issued>2009-06-07T19:43:10Z</issued> > <id>tag:gmail.google.com,2004:1304851949303996913</id> > <author> > <name>9News-CustomCast</name> > <email>9news-customc...@subs.myweather.net</email> > </author> > </entry> > ..... > When I do this: > var iframe = $("#frame")[0]; > var doc = iframe.contentDocument; > if(!doc) doc = iframe.contentWindow.document; > $("html", doc).load("atom.xml"); > > The html head tag gets the titles rather than the > <feed version="0.3" xmlns="http://purl.org/atom/ns#"> in the body? > > Is there a way to make the iframe look like an xml document instead of > an html doc?