$(...).tabs is not a function

Alex Bosnea picture Alex Bosnea · Jan 12, 2013 · Viewed 73.7k times · Source

I have this code on two pages on my site, but at one page the function doesn't work. Firebug shows me " $(...).tabs is not a function ". I don't understand why, can anyone tell me what is wrong ?

this is working: http://www.invat-online.net/variante-rezolvate

this is not working: http://www.invat-online.net/variante-explicate-limba-romana/varianta-01

Here is the code:

<div id="tabss">
    <ul>
        <li><a href="#SubiectI">Subiect I</a></li>
        <li><a href="#SubiectII">Subiect II</a></li>
        <li><a href="#SubiectIII">Subiect III</a></li>
    </ul>
    <div id="SubiectI">content here</div>
    <div id="SubiectII">content here</div>
    <div id="SubiectIII">content here</div>
</div>
$(document).ready(function() {
   $("#tabss").tabs();
});

Answer

Mihai Matei picture Mihai Matei · Jan 12, 2013

You have relative paths to javascript files:

javascript/jquery-ui-1.9.2.custom.min.js

change them to absolute paths because you're using mod_rewrite module

/javascript/jquery-ui-1.9.2.custom.min.js

In first link the server is looking to the directory

http://www.invat-online.net/javascript/my_js_file.js (which exists)

but in the second one the path will be

http://www.invat-online.net/variante-explicate-limba-romana/javascript/my_js_file.js which do not exists