Member Avatar for [NOPE]FOREVER

With $(document).ready() does your entire javascript code go into this function? or just the functions that you want to run automatically when the page has loaded?

Cheers

You just call the functions you need to run on page load. The jQuery construct $(document).ready() fires when the page has finished loading so you only need to place calls to javascript functions that need to run straight away.
You can place more functions there, particularly if you want to add in events for buttons clicks, text changed, etc.
If you have a standard javascript function (say onclick) that goes in the normal location - js dir or another file, however you would normally structure your projects.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.