mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
24 lines
734 B
JavaScript
24 lines
734 B
JavaScript
$(document).ready(function () {
|
|
var xhr = new XMLHttpRequest();
|
|
var url = "{{ some_url }}"
|
|
xhr.open("GET", url, true)
|
|
xhr.setRequestHeader("Content-Type", "application/json")
|
|
xhr.onreadystatechange = function () {
|
|
if (xhr.readyState !== 4) { return }
|
|
var json = JSON.parse(xhr.responseText)
|
|
$("#myThing").html(json.message); // caught with additional sources
|
|
}
|
|
try {
|
|
xhr.send()
|
|
} catch (error) {
|
|
console.log(error)
|
|
}
|
|
});
|
|
|
|
$(document).ready(async function () {
|
|
const got = require('got');
|
|
const resp = await got.get("{{ some_url }}");
|
|
const json = JSON.parse(resp.body);
|
|
$("#myThing").html(json.message); // caught with additional sources
|
|
|
|
}); |