Hey I had more of a conceptual than technical question. Is it better for pageload time to have one document ready function with the javascript for all pages included at the top of every webpage, or to have separate functions on every page with the script needed for only that page? The second makes more sense, but hey idk.
Don't load all your scripts at once for every page. This will cause unnecessary load times and as a result the user will think your page is loading slow.
Only load the scripts required for each page on a per page basis. Any time a script is encountered it will be cached, so they will all slowly be worked in if found instead of just one batch load all at once.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With