for a project I need to check the Response Code of a dynamically added JS into DOM. So Code looks basically like this one:
var newScript = document.createElement("script");
newScript.src = "http://www.example.com/dynamic-XXX.js";
target.appendChild(newScript);
The XXX will change and I am loading the File from Google Cloud Storage. So if I have a 200, everything is fine. But I need to check if I have 201 Status Code.
Any Ideas how to solve this in a nice way ?