views:

98

answers:

1

Hi, i'm trying to read a xml/atom file, the code is:

 $.ajax({
        type: 'GET',
        url: options.url,
        data: options.data,
        dataType: 'xml',
        async:options.async,
        success: function(xml) {
            var feed = new JFeed(xml);
            if(jQuery.isFunction(options.success)) options.success(feed);
        }
    });

The atom file has a field like this:

<entry>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml"&gt;Docentes y alumnos desa...</div>
  </content>
</entry>

The code to read the content tag is:

jQuery(this).find('content').eq(0).text();

this -> the entry part.

The problem is, when jQuery execute this line returns "Docentes y alumnos desa...". There is is a way that jQuery returns---->

"<div xmlns="http://www.w3.org/1999/xhtml"&gt;Docentes y alumnos desa...</div>"

Thanks!! and sorry for the english!!

A: 
jQuery(this).find('content').eq(0).html();

as from

http://api.jquery.com/html/

:]

Edit: sorry, should read the api better.

Here they solve something similar: http://refactormycode.com/codes/341-jquery-all-descendent-text-nodes-within-a-node

Adam Kiss
no men!! the api say:""This method is not available on XML documents.""=/ is there another way?
carrerasrodrigo
edited text with info :]
Adam Kiss