crop_rotate
Run
<!DOCTYPE html> <html> <body> <h2>JavaScript Callbacks</h2> <p id="demo"></p> <script> function myDisplayer(some) { document.getElementById("demo").innerHTML = some; } function getFile(myCallback) { let req = new XMLHttpRequest(); req.open('GET', "mycar.html"); req.onload = function() { if (req.status == 200) { myCallback(this.responseText); } else { myCallback("Error: " + req.status); } } req.send(); } getFile(myDisplayer); </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KDQo8aDI+SmF2YVNjcmlwdCBDYWxsYmFja3M8L2gyPg0KDQo8cCBpZD0iZGVtbyI+PC9wPg0KDQo8c2NyaXB0Pg0KZnVuY3Rpb24gbXlEaXNwbGF5ZXIoc29tZSkgew0KICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZGVtbyIpLmlubmVySFRNTCA9IHNvbWU7DQp9DQoNCmZ1bmN0aW9uIGdldEZpbGUobXlDYWxsYmFjaykgew0KICBsZXQgcmVxID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7DQogIHJlcS5vcGVuKCdHRVQnLCAibXljYXIuaHRtbCIpOw0KICByZXEub25sb2FkID0gZnVuY3Rpb24oKSB7DQogICAgaWYgKHJlcS5zdGF0dXMgPT0gMjAwKSB7DQogICAgICBteUNhbGxiYWNrKHRoaXMucmVzcG9uc2VUZXh0KTsNCiAgICB9IGVsc2Ugew0KICAgICAgbXlDYWxsYmFjaygiRXJyb3I6ICIgKyByZXEuc3RhdHVzKTsNCiAgICB9DQogIH0NCiAgcmVxLnNlbmQoKTsNCn0NCg0KZ2V0RmlsZShteURpc3BsYXllcik7IA0KPC9zY3JpcHQ+DQoNCjwvYm9keT4NCjwvaHRtbD4=