Giter VIP home page Giter VIP logo

Comments (3)

leemunroe avatar leemunroe commented on July 28, 2024

Wow, I didn't actually know this. Is it ok to remove this then or what is the down side?

from motherplate.

zanonnicola avatar zanonnicola commented on July 28, 2024

It is ok. If you insert JS at the bottom of your document the DOM will be ready by the time the parser gets to your script. The browser executes the script from the top to the bottom.

Doing so, the browser doesn't have to parse all the JS files and, by the time it reaches your scripts, the page is largely already displayed to the user. This improves perceived load time for your page.

You can find out more on this thread: http://stackoverflow.com/questions/6026645/document-readyfunction-vs-script-at-the-bottom-of-page

from motherplate.

leemunroe avatar leemunroe commented on July 28, 2024

Makes sense. I'm going to keep it in here anyway in case I move the main.js file to the head, which occasionally I do for one reason or another. Thanks for heads up though.

from motherplate.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.