Which is the best practice?

0 Dennis Siaw · February 3, 2015
When including JQUERY libraries and your own Javascript functions in your application, is it best to include it in your  <head></head> tag or at the end of the body tag. I mean
<!DOCTYPE html>
<!-- Is it this way -->
<script type="text/javascript" src="js/jquery.js"></script>

<!-- Or thits way -->
<script type="text/javascript" src="js/jquery.js"></script>

Post a Reply


Oldest  Newest  Rating
+1 Samuel Oloruntoba · February 14, 2015
It will run, but please refrain from placing javascript in the body tag, if you do please place them at the bottom of the page
+1 Samuel Oloruntoba · February 11, 2015
before the closing body tag is best, this way the html parser renders all html before javascript renders
0 Dennis Siaw · February 15, 2015
Thanks very much. Yeah it works!!
0 Samuel Oloruntoba · February 15, 2015
my pleasure
0 Dennis Siaw · February 12, 2015
Ok. And will all javascript and jquery functions written in the body tag run?
  • 1



A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.