MCPcopy Create free account
hub / github.com/adobe/Marinus / get_request

Function get_request

web_server/public/javascripts/config.js:477–499  ·  view source on GitHub ↗
(url, callback)

Source from the content-addressed store, hash-verified

475}
476
477function get_request(url, callback) {
478 var xhr = new XMLHttpRequest();
479 xhr.addEventListener("error", errorHandler);
480 xhr.onreadystatechange = function () {
481 if (xhr.readyState === 4 && xhr.status === 200) {
482 try {
483 var myObj = JSON.parse(xhr.responseText);
484 } catch (err) {
485 document.getElementById('errorMessage').innerHTML = "<b>Error: Bad JSON! <pre>" + err.message + "</pre></b>";
486 return;
487 }
488 callback(myObj);
489 } else if (xhr.status === 404) {
490 callback([]);
491 } else if (xhr.status === 500) {
492 document.getElementById('errorMessage').innerHTML = xhr.responseText;
493 }
494 };
495
496 xhr.open("GET", url);
497 xhr.send();
498 return;
499}

Callers 5

display_configFunction · 0.85
display_jobsFunction · 0.85
confirm_patch_updateFunction · 0.85
confirm_user_updateFunction · 0.85
find_zonesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected