Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uncaught exception: cannot call methods on tabs prior to initialization

I am using the following code to change the tab color on click

  $("ul.tabs").tabs("> .pane");

but it is throwing the error

uncaught exception: cannot call methods on tabs prior to initialization; attempted to call method '> .pane'

Could somebody help me with this what is this error?

like image 233
NoviceToDotNet Avatar asked Dec 11 '12 12:12

NoviceToDotNet


2 Answers

Its pretty straight forward as the exception says. Your tabs must be initialized before you can work on them. So initialize them.

function(){
$("ul.tabs").tabs();
}

or simply by using

$("ul.tabs").tabs().tabs($("div.panes > div"), action);
like image 141
Aravind Avatar answered Oct 18 '22 05:10

Aravind


I don't know what do you expect to get using this code, but it's wrong. You shouldn't pass selector as an attribute for .tabs() method. Look at the jQuery UI Tabs API for how to use it.

like image 28
pxx Avatar answered Oct 18 '22 04:10

pxx