i have one html page named "text.html"
<html>
<body>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="js/Photos.js"></script>
<script type="text/javascript" src="js/Animations.js"></script>
</body>
</html>
Both Photos.js and Animations.js start with "$(document).ready()" like this
//Javascript File Photos.js
$(document).ready(function() {
//My code here ....
});
//Javascript File Animations.js
$(document).ready(function() {
//My code here ....
});
Does it matter if i use multiple $(document).ready(function() { in a single html page??
Thanks, in advance
You can use as many as you would like, but its best to keep it to one for readability.
Also consider using short hand $(function() { ... });