Ticket #220: jquery-220.2.patch
| File jquery-220.2.patch, 1.4 KB (added by jaq@…, 7 years ago) |
|---|
-
src/jquery/jquery.js
392 392 * @test ok( $('#name').attr('name') == "name", 'Check for name attribute' ); 393 393 * @test ok( $('#text1').attr('name') == "action", 'Check for name attribute' ); 394 394 * @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' ); 395 403 * 396 404 * @name attr 397 405 * @type Object … … 1824 1832 if ( fix[name] ) { 1825 1833 if ( value != undefined ) elem[fix[name]] = value; 1826 1834 return elem[fix[name]]; 1827 } else if ( elem.getAttribute != undefined) {1835 } else if ( typeof elem.getAttribute != "undefined" ) { 1828 1836 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 } 1830 1842 } else { 1831 1843 name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();}); 1832 1844 if ( value != undefined ) elem[name] = value;
