Reputation: 2449
This is the code I am using at the bottom of my javascript (just to test) in order to get my functions working on page load:
// Call to load
$(document).ready(function()
{
test();
}
At the top of my javascript file I have this:
function test() {
alert("hello")
};
Why isnt my test being called?
Upvotes: 0
Views: 449
Reputation: 12020
Look closer at your jQuery call:
// Call to load
$(document).ready(function()
{
test();
}
You're missing the end ) and a semicolon.
// Call to load
$(document).ready(function()
{
test();
});
You could tell this if you checked the console in your browser.
Upvotes: 6
Reputation:
There's a typo(you missed one bracket):
$(document).ready(function()
{
test();
});
Upvotes: 4