});\r
\r
test("attr(String)", function() {\r
- expect(15);\r
+ expect(13);\r
ok( $('#text1').attr('value') == "Test", 'Check for value attribute' );\r
ok( $('#text1').attr('type') == "text", 'Check for type attribute' );\r
ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' );\r
\r
$('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path\r
ok( $('#tAnchor5').attr('href') == "#5", 'Check for non-absolute href (an anchor)' );\r
- \r
- stop();\r
- $.get("data/dashboard.xml", function(xml) {\r
- ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );\r
- ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" );\r
- start();\r
- });\r
});\r
\r
+if ( location.protocol != "file:" ) {\r
+ test("attr(String) in XML Files", function() {\r
+ expect(2);\r
+ stop();\r
+ $.get("data/dashboard.xml", function(xml) {\r
+ ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );\r
+ ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" );\r
+ start();\r
+ });\r
+ });\r
+}\r
+\r
test("attr(String, Function)", function() {\r
expect(2);\r
ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" );\r