1 | <!doctype html> |
---|
2 | <html lang="en"> |
---|
3 | <head> |
---|
4 | <title>Tabs - Custom Content via Ajax Request</title> |
---|
5 | <meta charset="utf-8" /> |
---|
6 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> |
---|
7 | <meta name="description" content="Content via Ajax" /> |
---|
8 | <meta name="keywords" content="" /> |
---|
9 | <meta name="author" content="ComponentOne" /> |
---|
10 | |
---|
11 | <link href="../../themes/rocket/jquery-wijmo.css" rel="stylesheet" type="text/css" /> |
---|
12 | |
---|
13 | <script src="../../external/jquery-1.8.0.min.js" type="text/javascript"></script> |
---|
14 | <script src="../../external/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script> |
---|
15 | <link href="../../themes/wijmo/jquery.wijmo.wijtabs.css" rel="stylesheet" type="text/css" /> |
---|
16 | <script src="../../wijmo/jquery.wijmo.wijtabs.js" type="text/javascript"></script> |
---|
17 | <script id="scriptInit" type="text/javascript"> |
---|
18 | $(function () { |
---|
19 | |
---|
20 | function loadContent(ui, ajaxOptions) { |
---|
21 | var url = 'ajax/content' + (ui.index + 1) + '.html'; |
---|
22 | $.ajax($.extend({}, ajaxOptions, { |
---|
23 | url: url, |
---|
24 | success: function (r, s) { |
---|
25 | r = "<p style='color:blue'>Customized content:</p>" + r; |
---|
26 | $(ui.panel).html(r); |
---|
27 | try { |
---|
28 | ajaxOptions.success(r, s); |
---|
29 | } |
---|
30 | catch (e1) { } |
---|
31 | }, |
---|
32 | error: function (xhr, s, e) { |
---|
33 | $(ui.panel).html( |
---|
34 | "Couldn't load this tab. We'll try to fix this as soon as possible. " + |
---|
35 | "If this wouldn't be a demo."); |
---|
36 | try { |
---|
37 | ajaxOptions.error(xhr, s, ui.index, ui.tab); |
---|
38 | } |
---|
39 | catch (e2) { } |
---|
40 | } |
---|
41 | })); |
---|
42 | } |
---|
43 | |
---|
44 | $("#tabs").wijtabs({ |
---|
45 | beforeShow: function (event, ui) { |
---|
46 | loadContent(ui); |
---|
47 | return false; |
---|
48 | } |
---|
49 | }); |
---|
50 | }); |
---|
51 | |
---|
52 | </script> |
---|
53 | </head> |
---|
54 | <body class="demo-single"> |
---|
55 | <div class="container"> |
---|
56 | <div class="header"> |
---|
57 | <h2> |
---|
58 | Overview</h2> |
---|
59 | </div> |
---|
60 | <div class="main demo"> |
---|
61 | <div id="tabs"> |
---|
62 | <ul> |
---|
63 | <li><a>Tab 1</a></li> |
---|
64 | <li><a>Tab 2</a></li> |
---|
65 | <li><a>Tab 3</a></li> |
---|
66 | </ul> |
---|
67 | </div> |
---|
68 | <!-- End demo markup --> |
---|
69 | <div class="demo-options"> |
---|
70 | <!-- Begin options markup --> |
---|
71 | <!-- End options markup --> |
---|
72 | </div> |
---|
73 | </div> |
---|
74 | <div class="footer demo-description"> |
---|
75 | <p> |
---|
76 | In this sample, the wijwizard widget loads pages via Ajax. The sample shows you |
---|
77 | how the wijwizard handles different pages in Ajax. For example, it shows you how |
---|
78 | it would work preloaded, how it would work normally, how it would work with a slow |
---|
79 | page, and how it would work if a page were disabled. |
---|
80 | </p> |
---|
81 | </div> |
---|
82 | </div> |
---|
83 | </body> |
---|
84 | </html> |
---|