This project is archived and is in readonly mode.

#508 ✓invalid
Jari Berg

$A fails on XML getElementsByTagName in IE

Reported by Jari Berg | December 3rd, 2008 @ 02:29 PM

NB! Only IE fails ;)

// failure in IE var myArray = $A(xml.documentElement.getElementsByTagName('node'));

// success ... tralala works in all browsers var myArray = [].extend(xml.documentElement.getElementsByTagName('node'));

Also a suggestion to $A() - returning empty array if having no arguments.

// support non-existing argument if (!iterable) return new Array();

Proposal to $A function:

function $A(iterable) {

if (!iterable) return new Array();
if (Browser.Engine.trident) {
    return [].extend(iterable);
} else if (iterable.item) {
    var array = [];
    for (var i = 0, l = iterable.length; i < l; i++) array[i] = iterable[i];
    return array;


Comments and changes to this ticket

  • fakedarren

    fakedarren February 8th, 2010 @ 04:38 PM

    • State changed from “new” to “invalid”
    • Assigned user cleared.
    • Milestone cleared.

    We may support XML in the future but currently we do not.

    Also $A is for arrays, not nodeLists.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket