Case is that:
My script inserts
<script>
in<head>
, pointing to src1.The back-end does 307 redirect from src1 to src2.
Script then loads src2.
But when I use this code, I'm getting src1.
var s = document.createElement("SCRIPT"),
h = document.getElementsByTagName("HEAD")[0];
s.charset = "UTF-8";
s.src = url;
s.async = true;
s.type = "text/javascript";
h.appendChild(s);
s.onload = function() {
console.log(this.src)
}
How can I get the src2?