UNPKG

ziko

Version:

A versatile JavaScript library offering a rich set of Hyperscript Based UI components, advanced mathematical utilities, interactivity ,animations, client side routing and more ...

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}