"undefined is not a function" when calling "tabs"

2

I have an error in my JS function, when I see through the browser, it shows the following message:

  

undefined is not a function

Please, do you have any tips on this error?

<link rel="stylesheet"    href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">

<script>
  $(function () {
    $("#tabs").tabs();// undefined is not a function 
  });
</script>
    
asked by anonymous 02.02.2015 / 17:35

3 answers

1

I assume you are using the FILE protocol rather than an HTTP server on your machine.

The use of the abbreviated protocol // only works if the page loads in HTTP . On pages with protocol FILE // is interpreted in Windows for example as D: or C: ( or rather saying // accesses the root folder), rather than pulling the CDN server from Jquery the files the browser will try to pull from your local machine.

The preferred one to develop on your machine is to use an HTTP server as:

  

Read about the HTTP protocol: link

So when using Apache (for example) with <link href="//..."> the browser will interpret // as http or https .

The advantage of using // is that your page is HTTPS (http with security certificate) , there will be no "security locks" or "error messages" (of course the CDN you use will have to be supported by SSL or TLS ).

But if you are sure that you will not use https on your site, then use http without "abbreviation" or you really want to develop at FILE :

  <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
  <script src="http://code.jquery.com/jquery-1.10.2.js"></script><scriptsrc="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
    
02.02.2015 / 21:15
0

You must have forgotten to load the plugin code. When you try to call the property .tabs , its value will be undefined and the parentheses will attempt to invoke it as a function, generating the error.

    
02.02.2015 / 17:51
0

Friend is the path of the plugins, below is the correct one

<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script><scriptsrc="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
    
02.02.2015 / 21:04