aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-03-24 02:07:37 +0000
committerJohn Resig <jeresig@gmail.com>2007-03-24 02:07:37 +0000
commit6d03f9290eb7b3f51b18413acdbd61d856749174 (patch)
tree3070315e7f47c2aa1256eea4fbeb1186dcec8ea4 /src
parent0f7c89cd97de6ca644a834a119dda1e057fd724e (diff)
downloadjquery-6d03f9290eb7b3f51b18413acdbd61d856749174.tar.gz
jquery-6d03f9290eb7b3f51b18413acdbd61d856749174.zip
An Ajax-based test was being run locally (which doesn't work).
Diffstat (limited to 'src')
-rw-r--r--src/jquery/coreTest.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js
index 5c982ee22..ab47c463c 100644
--- a/src/jquery/coreTest.js
+++ b/src/jquery/coreTest.js
@@ -159,7 +159,7 @@ test("index(Object)", function() {
});
test("attr(String)", function() {
- expect(15);
+ expect(13);
ok( $('#text1').attr('value') == "Test", 'Check for value attribute' );
ok( $('#text1').attr('type') == "text", 'Check for type attribute' );
ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' );
@@ -175,15 +175,20 @@ test("attr(String)", function() {
$('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path
ok( $('#tAnchor5').attr('href') == "#5", 'Check for non-absolute href (an anchor)' );
-
- stop();
- $.get("data/dashboard.xml", function(xml) {
- ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );
- ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" );
- start();
- });
});
+if ( location.protocol != "file:" ) {
+ test("attr(String) in XML Files", function() {
+ expect(2);
+ stop();
+ $.get("data/dashboard.xml", function(xml) {
+ ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );
+ ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" );
+ start();
+ });
+ });
+}
+
test("attr(String, Function)", function() {
expect(2);
ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" );