you are the best django teacher in youtube, appreciate
@cainabel20093 жыл бұрын
12:45 The reason why the Js tags scripts are added at the bottom of the body tag is because this guarantees that the entire page which might or might not contain JS is loaded before the Javascript script is called. If the JS tags are placed in the head tag and the body of the page contains Javascript this means that JS tag in the head will be called and since the page containing the JS has not yet loaded this will result in an error. Now, depending on how fast your computer or network the JS in the body can be loaded before the JS tag in the head is called this will result in it work but if not this will result in an error. Since you don't want your JS script tags to depend on how fast the page loads it is better to place it at the bottom of the body tag this ensure that the entire page has been rendered.
@13yadav4 жыл бұрын
12:45 the reason is that css is needed at time of loading the site(i.e. designs etc ) but js is only needed when the website is fully loaded to perform click actions or other type of actions. if we place js at the top the site will take time to load ~ i think
@HoraceBentley4 жыл бұрын
Pretty much! You want css to already be in place when html elements are instantiated; otherwise, you could see vanilla 1995 html briefly before css reformats the whole screen. Likewise, you want all of your html to be in place when the js starts work so that when js looks for elements, they will be there, thus avoiding 'abc() is not a function of undefined' and friendly little error msgs like that.
@keshavkhandelwal83163 жыл бұрын
script src="{% static 'bootstrap/js/jquery.min.js' %}"> there is no jquery.js in this directory
@tennis00374 жыл бұрын
I did python manage.py collectstatic. It collected the same amount of files as you. It created the admin folder but it did not create the bootstrap folder. My bootstrap properties are not showing up on my site. I'm using bootstrap 4.5.3. Not sure if that matters. But I did everything else the same.
@tennis00374 жыл бұрын
I put FILES_DIRS instead of STATICFILES_DIRS. It works now (:
@devnextbd4 жыл бұрын
Thank you so much
@zyz11534 жыл бұрын
there is no jquery.js in this directory
@joemurawski37903 жыл бұрын
I am currently having problems with the next vid due to this
@KevinTempelx4 жыл бұрын
Thanks!
@erdemsym3 жыл бұрын
Would you upload english subtitle? thank you, best.