jquery ui ajax tab using aria-control instead of url
In jquery-ui 1.10.3 the url method had been replaced with aria-control method.
I can't work out how to use it.
I am trying to load data from a file called action.php
action.php file sends the message "Contents from the server"
I need to place it in the first of three tabs.
It does not work. I get the following message displayed on the chrome console
Uncaught Error: no such method 'aria-controls' for tabs widget instance
I have the following code:
- <div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
- <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
- <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#tab1">Tab 1</a>
- </li>
- <li class="ui-state-default ui-corner-top"><a href="#tab2">Tab 2</a>
- </li>
- <li class="ui-state-default ui-corner-top"><a href="#tab3">Tab 3</a>
- </li>
- </ul>
- <div id="tab1" class="ui-tabs-panel ui-widget-content ui-corner-bottom">Contents of first tab.</div>
- <div id="tab2" class="ui-tabs-panel ui-widget-content ui-corner-bottom">Contents of the second tab</div>
- <div id="tab3" class="ui-tabs-panel ui-widget-content ui-corner-bottom">Contents of the third tab</div>
- </div>
- <script type="text/javascript">
- (function ($) {
- $("#tabs").tabs().tabs("aria-controls", 0, "action.php").tabs("load", 0);
- })(jQuery);
- </script>