I have an .js file that has certain functions:
$(function(){
function slideDown(class) {
var className = class;
$('.slide_' + className).slideDown('slow', function() {
});
}
});
(And yes i added the .js file in the heading and it’s showing in the firebug console.)
And i got an link that calls the function:
<a href="#" onclick="slideDown('.$x.');" class="info">i</a>
But when i press the button my firebug gives the following error:
ReferenceError: slideDown is not defined
So what am i doing wrong?
You are declaring
slideDownin another function so it is only available inside that function, declare it outside the function so it will have global scope.