You can insert this into a valid table that is still inserted into the DOM.
So you would do someting like:
$('id_of_tbody_or_thead').set('html', responseText);
Note that as i said the tbody or thead should be still into the DOM into a
table, or as you said you will lose the 'th' tags.
--
Fábio Miranda Costa
Solucione Sistemas
Front-End Engineer
http://meiocodigo.com
On Wed, Sep 9, 2009 at 12:40 PM, darpi <[email protected]> wrote:
>
> Dear All,
> maybe is a silly question, but I can't figure out how to
> have an element from a responseText from Request.
> I know that I can use request.html, but this can help me better
> understand some html/javascript/mootools activities.
>
> I receive for example from a request this code:
> <tr><th>mutuls</th><th>you are welcome</th></tr>
> <tr><th>mutuls2</th><th>you are welcome 2</th></tr>
> <tr><th>mutuls3</th><th>yoou are welcome again</th></tr>
>
> In the request....
> onSuccess: function(responseText, responseXML) {
>
> I'd like to inject these rows inside an exiting table after an
> element.
>
> It would be:
> myresponseTextElement.inject(myTableRow,'after')
>
> The question is: how obtain myresponseTextElement from responseText?
>
> var myresponseTextElement=new Element('tr')
> myresponseTextElement.set('html',responseText);
> This way I loose all <th> tags.
>
> Any suggestions???
>
> }
>
> Thanks, Dario