当我放在正文之前但是在标题中工作时,Javascript无法正常工作

for some odd reason my console is showing "[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience."

I know that is has something to do with how I am double loading my scripts but website only seems to function perfectly when I add both the scripts in the header and before the body. When I try to add my scripts only in the body before the the closing tag my javascript completely stop working, im using mostly jquery for everything and my whole custom.js is wrapped in the $(document).ready() i dont understand

so heres how I load my script and and it works fine I add

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://js.pusher.com/3.0/pusher.min.js"></script>
<script src="bootstrap2/js/bootstrap.min.js"></script>
<script src="js/custom.js" type="text/javascript"></script>

to the header

This is the script that I place before my closing body tag

<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="bootstrap2/js/bootstrap.min.js"></script>
<script src="js/custom.js" type="text/javascript"></script>

</body> 

so the deprecation messages disappears when i added it all to the closing body tag so im sure it has something to do with it maybe it has something to do with the order but i cant figure it out

You have to load jQuery library before loading jQuery-UI library since it is dependent on it. Even I had faced the same error when I started my career!