calling a function within the jQuery ready function from another javascript file
I have 2 javascript files: 1 containing generic functions for my site used sitewide and another for a particular web page containing just the javascript for that page. The page is also calling the jQuery javascript file.
What I want to do is have a javascript function in my main javascript file which uses features of jQuery such as show, hide etc. and then I want to call this javascript function from the other page specific javascript file.
i.e. my main javascript functions file contains:
$(document).ready(function(){
function helloWorld(divId, message){
$("#" divId).html(message);
}
----Plus some other jQuery stuff----
});
and then the page specific javascript file contains:
$(document).ready(function(){
helloWorld('myDiv', 'Hello world!');
----Plus some other jQuery stuff----
});
This does not work and so was wondering if anyone can point me in the right direction as to how to achieve this or something similar. Hope someone can help. Many thanks in advance.
Ash