diff options
author | jaubourg <j@ubourg.net> | 2011-02-03 06:12:47 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-02-03 06:12:47 +0100 |
commit | ee22a59129e082a2bb9f5bc0b085191ab6faafc8 (patch) | |
tree | 1dec7c60c9f9918a5a4afb2303301b818ae40ce9 /test/localfile.html | |
parent | 50e950a96e0fae23a1ae418951a298e2949ff351 (diff) | |
download | jquery-ee22a59129e082a2bb9f5bc0b085191ab6faafc8.tar.gz jquery-ee22a59129e082a2bb9f5bc0b085191ab6faafc8.zip |
Stores jQuery.ajaxSettings.isLocal locally at load time so that any change to it won't affect the transport. Fixes the url parsing regexp to deal with empty domains. Adds informative text into test/localfile.html and handles Opera's failure. Revises the way xhr are created by doing all tests at load time and normalizes all the xhr creation functions so that none of them may throw an exception.
Diffstat (limited to 'test/localfile.html')
-rw-r--r-- | test/localfile.html | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/test/localfile.html b/test/localfile.html index 802163133..b354612a5 100644 --- a/test/localfile.html +++ b/test/localfile.html @@ -25,16 +25,32 @@ </head> <body> + <h1>jQuery Local File Test</h1> + <ul> + <li> + Access this file using the "file:" protocol. + </li> + <li> + Two lines must appear below. + </li> + <li> + Opera will fail at detecting errors, it's a known issue. + </li> + </ul> <script> - jQuery.ajax( "data/badjson.js" , { - dataType: "text" - }).success(function() { - $( "<div/>" ).text( "Success OK" ).appendTo( "body" ); - }); - jQuery.ajax( "data/doesnotexist.ext" , { - dataType: "text" - }).error(function() { - $( "<div/>" ).text( "Error OK" ).appendTo( "body" ); - }); + jQuery.ajax( "data/badjson.js" , { + dataType: "text" + }).success(function() { + jQuery( "<div/>" ).text( "Success OK" ).appendTo( "body" ); + }); + jQuery.ajax( "data/doesnotexist.ext" , { + dataType: "text" + }).error(function() { + jQuery( "<div/>" ).text( "Error OK" ).appendTo( "body" ); + }).success(function() { + if ( jQuery.browser.opera ) { + jQuery( "<div/>" ).text( "Error Fail (Opera)" ).appendTo( "body" ); + } + }); </script> </body>
\ No newline at end of file |