I'm not new to web design, but I'm just wondering if you guys have any advice for me:
Whenever I write js or jQuery, I write all the code like this in <head>on my page:
<script>
$(document).ready(function() {
});
</script>
Now, when I browse the web, I see that most people have their functions and animations in a separate .js file. And they also often create classes.
How it works? What is the advantage of creating classes and your functions in a separate file?
Thanks VG
source
share