UNPKG

ziko

Version:

a versatile javaScript framework offering a rich set of UI components, advanced mathematical utilities, reactivity, animations, client side routing and graphics capabilities

11 lines 301 B
const preload=(url)=>{ const xhr = new XMLHttpRequest(); xhr.open("GET", url, false); xhr.send(); if (xhr.status === 200) { return xhr.responseText; } else { throw new Error(`Failed to fetch data from ${url}. Status: ${xhr.status}`); } } export {preload}