jquery ui ajax tab using aria-control instead of url

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:

  1. <div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
  2. <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
  3. <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#tab1">Tab 1</a>
  4. </li>
  5. <li class="ui-state-default ui-corner-top"><a href="#tab2">Tab 2</a>
  6. </li>
  7. <li class="ui-state-default ui-corner-top"><a href="#tab3">Tab 3</a>
  8. </li>
  9. </ul>
  10. <div id="tab1" class="ui-tabs-panel ui-widget-content ui-corner-bottom">Contents of first tab.</div>
  11. <div id="tab2" class="ui-tabs-panel ui-widget-content ui-corner-bottom">Contents of the second tab</div>
  12. <div id="tab3" class="ui-tabs-panel ui-widget-content ui-corner-bottom">Contents of the third tab</div>
  13. </div>
  14. <script type="text/javascript">
  15. (function ($) {
  16. $("#tabs").tabs().tabs("aria-controls", 0, "action.php").tabs("load", 0);
  17. })(jQuery);
  18. </script>