diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2010-02-24 18:43:33 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2010-02-24 18:43:33 +0000 |
commit | a5eab4cc38c73c3c54b9c6a6d071ad93263f50f5 (patch) | |
tree | b6d2c12e0e974f2fd4b7263fceae918396cdad87 /demos/tabs/ajax.html | |
parent | c27bc6b0355899d7d5cf40e594fa033e159b7653 (diff) | |
download | jquery-ui-a5eab4cc38c73c3c54b9c6a6d071ad93263f50f5.tar.gz jquery-ui-a5eab4cc38c73c3c54b9c6a6d071ad93263f50f5.zip |
Fix for #4451 - ajax tabs error handling
Diffstat (limited to 'demos/tabs/ajax.html')
-rw-r--r-- | demos/tabs/ajax.html | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/demos/tabs/ajax.html b/demos/tabs/ajax.html index c531e1ba9..1bb8e5130 100644 --- a/demos/tabs/ajax.html +++ b/demos/tabs/ajax.html @@ -10,7 +10,13 @@ <link type="text/css" href="../demos.css" rel="stylesheet" /> <script type="text/javascript"> $(function() { - $("#tabs").tabs(); + $("#tabs").tabs({ + ajaxOptions: { + error: function(xhr, status, index, anchor) { + $(anchor.hash).html("Couldn't load this tab. We'll try to fix this as soon as possible. If this wouldn't be a demo."); + } + } + }); }); </script> </head> @@ -23,6 +29,8 @@ <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="ajax/content1.html">Ajax Tab 1</a></li> <li><a href="ajax/content2.html">Ajax Tab 2</a></li> + <li><a href="ajax/content3-slow.php">Ajax Tab 3 (slow)</a></li> + <li><a href="ajax/content4-broken.php">Ajax Tab 4 (broken)</a></li> </ul> <div id="tabs-1"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p> @@ -35,6 +43,7 @@ <p>Fetch external content via Ajax for the tabs by setting an href value in the tab links. While the Ajax request is waiting for a response, the tab label changes to say "Loading...", then returns to the normal label once loaded.</p> +<p>Tabs 3 and 4 demonstrate slow-loading and broken AJAX tabs, and how to handle serverside errors in those cases. Note: These two require a webserver to interpret PHP. They won't work from the filesystem.</p> </div><!-- End demo-description --> </body> |