Jump to content

Dobrutro

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Dobrutro

  1. To the topic about position of external javascript file. Issue about my question was that I forgot about small detail. If we have external javascript and tag in head, we can use attribute defer="true" so it will be loaded at end. So we are not forced to put script tag to end of file. At least I understand this such way from w3school lesson about performance as alternative.

  2. Sorry for my bad English. I had very similar question like author of this topic, maybe I don't understand everything correct.

     

    For some time I though that position of script tag have matter only if its inline of HTML file. If you put long script before body, and your web browser must spend more time on interpretation this lines of code before HTML than it will show up later. But if you put js in external file it work different way and no matter where you put it it should be called only when DOM call was made. So different way from link tag that is threat like code was exactly there, like CSS that is read and must be read before HTML when interpreter of browser check the code to show off.

     

    My question is maybe stupid, but like to be sure. Because lots of people and pages sometimes copy one answer all the time over the web, and sometimes it result is some "web myths" that nobody veryfying. Can someone confirm this with they work experience on large projects where you really see the difference?

×
×
  • Create New...