[SabaziaLUG] Aiuto per newbie di js e dom

Edoardo Poeta edoardo.poeta@gmail.com
Gio 14 Apr 2011 22:58:39 CEST


Sono un ignorante crasso di dom e js, ma devo per necessità estrema
ricorrere alla Google Feed Api. Recuperato il feed lo devo restituire con
questo output per ragioni di css:

<span>mese anno</span><a href="link">Titolo</a>

Ho scritto

var entry = result.feed.entries[i];
            var div = document.createElement("div");
            var link1 = document.createElement('a');
            var li = document.createElement('li');
            var span = document.createElement('span');

            var data = new Date(entry.publishedDate);
            var data1 = data.getMonth() + ' ' + data.getFullYear();


            link1.appendChild(document.createTextNode(entry.title));
            link1.setAttribute('href', entry.link);

            span.appendChild(document.createTextNode(data1));
            span.appendChild(link1)
            li.appendChild(span)
            div.appendChild(li)

            container.appendChild(div);

ottengo ovviamente questo
<span xmlns="http://www.w3.org/1999/xhtml">2 2011<a href="
http://issuu.com/thinkquarterly/docs/01-data/1">Think Quarterly - 01
Data</a></span>

invece vorrei ottenere questo
<span xmlns="http://www.w3.org/1999/xhtml">2 2011</span><a href="
http://issuu.com/thinkquarterly/docs/01-data/1">Think Quarterly - 01
Data</a>

C'è qualche anima pia che mi può aiutare? So che è una cosa banale, ma non
ci riesco... e sto perdendoci ore!

Grazie!

E.
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.linux.it/pipermail/sabazialug/attachments/20110414/d8a9098a/attachment.htm>


Maggiori informazioni sulla lista SabaziaLUG