});\r
\r
test("attr(String, Function)", function() {\r
+ expect(1);\r
ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" );\r
- ok( $('#text2').attr('value', "${this.id}")[0].value == "text2", "Set value from id" );\r
});\r
\r
test("attr(Hash)", function() {\r
ok( document.getElementById('text1').readOnly == false, 'Set readonly attribute' );\r
});\r
\r
-test("attr(String, Object)x", function() {\r
- expect(2);\r
- stop();\r
- $.get('data/dashboard.xml', function(xml) { \r
- var titles = [];\r
- $('tab', xml).each(function() {\r
- titles.push($(this).attr('title'));\r
- });\r
- ok( titles[0] == 'Location', 'attr() in XML context: Check first title' );\r
- ok( titles[1] == 'Users', 'attr() in XML context: Check second title' );\r
- start();\r
+if ( location.protocol != "file:" ) {\r
+ test("attr(String, Object)x", function() {\r
+ expect(2);\r
+ stop();\r
+ $.get('data/dashboard.xml', function(xml) { \r
+ var titles = [];\r
+ $('tab', xml).each(function() {\r
+ titles.push($(this).attr('title'));\r
+ });\r
+ ok( titles[0] == 'Location', 'attr() in XML context: Check first title' );\r
+ ok( titles[1] == 'Users', 'attr() in XML context: Check second title' );\r
+ start();\r
+ });\r
});\r
-});\r
+}\r
\r
test("css(String|Hash)", function() {\r
expect(8);\r
ok( $('#mark').removeAttr("class")[0].className == "", "remove class" );\r
});\r
\r
+test("text(String)", function() {\r
+ expect(1);\r
+ ok( $("#foo").text("<div><b>Hello</b> cruel world!</div>")[0].innerHTML == "<div><b>Hello</b> cruel world!</div>", "Check escaped text" );\r
+});\r