Bug Tracker

Ticket #220: jquery-220.2.patch

File jquery-220.2.patch, 1.4 KB (added by jaq@…, 7 years ago)

patch for the problem

  • src/jquery/jquery.js

     
    392392         * @test ok( $('#name').attr('name') == "name", 'Check for name attribute' ); 
    393393         * @test ok( $('#text1').attr('name') == "action", 'Check for name attribute' ); 
    394394         * @test ok( $('#form').attr('action') == "formaction", 'Check for action attribute' ); 
     395         * @test var xmltext = '<test><child myattr="hello"/></test>'; 
     396         * var xmldoc; 
     397         * try { 
     398         *      xmldoc = new DOMParser().parseFromString(xmltext, 'text/xml'); 
     399         * } catch(ex) { 
     400         *      xmldoc = new ActiveXObject('Microsoft.XMLDOM'); xmldoc.loadXML(xmltext); 
     401         * } 
     402         * ok( $('child', xmldoc).attr('myattr') == "hello", 'Check for read attribute from XML doc' ); 
    395403         *  
    396404         * @name attr 
    397405         * @type Object 
     
    18241832                if ( fix[name] ) { 
    18251833                        if ( value != undefined ) elem[fix[name]] = value; 
    18261834                        return elem[fix[name]]; 
    1827                 } else if ( elem.getAttribute != undefined ) { 
     1835                } else if ( typeof elem.getAttribute != "undefined" ) { 
    18281836                        if ( value != undefined ) elem.setAttribute( name, value ); 
    1829                         return elem.getAttribute( name, 2 ); 
     1837                        try { 
     1838                                return elem.getAttribute( name, 2 ); 
     1839                        } catch(ex) { 
     1840                                return elem.getAttribute(name); 
     1841                        } 
    18301842                } else { 
    18311843                        name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();}); 
    18321844                        if ( value != undefined ) elem[name] = value;