There is no onload event, I can not understand why?

<script> ... var toremReq = new XMLHttpRequest(); toremReq.open("post", "https:xxx/barcoderequest.php", true); toremReq.onprogress = function () { console.log('ONPROGRESS', toremReq.status); alert('ONPROGRESS'); }; toremReq.onload = function () { console.log('ONLOAD', toremReq.status); alert('ONLOAD'); }; toremReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"); toremReq.send(null); ... </script> 
  • what does the console give you? There must be some mistake. For example, that cross domain requests are not supported - ArchDemon
  • issued onprogress 0 and that's it, - Samsonin

1 answer 1

figured out, the problem was that the page sent the form of another request too quickly, without waiting for an answer to this, as soon as it changed from true to false: toremReq.open ("post", "https: xxx / barcoderequest.php", false); everything worked, thank you all for your help