});\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
ok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' );\r
\r
// test is() with comma-seperated expressions\r
- ok( $('#en').is('[@lang="en"],[@lang="de"]'), 'Check for lang attribute: Expecte en or de' );\r
- ok( $('#en').is('[@lang="de"],[@lang="en"]'), 'Check for lang attribute: Expecte en or de' );\r
- ok( $('#en').is('[@lang="en"] , [@lang="de"]'), 'Check for lang attribute: Expecte en or de' );\r
- ok( $('#en').is('[@lang="de"] , [@lang="en"]'), 'Check for lang attribute: Expecte en or de' );\r
+ ok( $('#en').is('[@lang="en"],[@lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' );\r
+ ok( $('#en').is('[@lang="de"],[@lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' );\r
+ ok( $('#en').is('[@lang="en"] , [@lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' );\r
+ ok( $('#en').is('[@lang="de"] , [@lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' );\r
});\r
\r
test("$.extend(Object, Object)", function() {\r
return false;\r
}).click();\r
});\r
+\r
+test("$().html().evalScripts() Eval's Scripts Twice in Firefox, see #975", function() {\r
+ expect(1);\r
+ $("#main").html('<script type="text/javascript">ok( true, "execute script" );</script>').evalScripts();\r
+});\r
+\r
+test("$('<tag>') needs optional document parameter to ease cross-frame DOM wrangling, see #968", function() {\r
+ var f = frames["iframe"].document;\r
+ f.open();\r
+ f.write("<html><body></body></html>");\r
+ f.close();\r
+ $("<div>Testing</div>").appendTo(f.body);\r
+ ok( true, "passed" );\r
+});
\ No newline at end of file