[Greasemonkey] Bug in GM_xmlhttpRequest?
alan taylor
kokogiak at gmail.com
Wed May 4 13:34:47 EDT 2005
I can vouch for this - happens to me as well (though I assumed it was
my own fault).
-Alan Taylor
On 5/4/05, Mark Pilgrim <pilgrim at gmail.com> wrote:
> I'm calling GM_xmlhttpRequest and my onload callback function is
> getting called twice. Is this expected behavior?
>
> code snippet:
>
> GM_xmlhttpRequest({
> method: 'GET',
> url: 'http://greaseblog.blogspot.com/atom.xml',
> headers: {
> 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
> 'Accept': 'application/atom+xml,application/xml,text/xml',
> },
> onload: function(responseDetails) {
> var parser = new DOMParser();
> var dom = parser.parseFromString(responseDetails.responseText,
> "application/xml");
> var entries = dom.getElementsByTagName('entry');
> var title, p;
> for (var i in entries) {
> title = entries[i].getElementsByTagName('title')[0];
> p = document.createElement('p');
> p.appendChild(document.createTextNode(title.textContent));
> document.body.appendChild(p);
> }
> }
> });
>
> --
> Cheers,
> -Mark
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>
More information about the Greasemonkey
mailing list