Again to clear point of issue about to the position to put code into the pages.
"adding the code below into the bottom of the page. "
Where is the bottom of the page?
Do you mean position of #5 in the following?
<html>
#1
<head>
#2
</head>
#3
<body>
#4
</body>
#5
</html >
#6
Actually, all javascript have to put into the position #2.