Why are all the script inserted by jsonp in head?

Why are all the script inserted by jsonp in head? Instead of the bottom of the body?

Aug.30,2021

this is related to the library you use, because the script tag is also dynamically inserted into the page after the request is completed, and the location is related to the library.


can also be found in body, refer to the example of w3schools :

function clickButton() {
    var s = document.createElement("script");
    s.src = "demo_jsonp.php";
    document.body.appendChild(s);
}


because the library is set like this

it's good to think about it, and if you insert body, it's likely that body hasn't been loaded yet.

of course, it is also possible that head did not finish loading, but at least it is much safer than body, because it must be finished loading head, first and then loading body

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaf991-699dc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaf991-699dc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?