Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

white for file loaded

async function getFile() {
  let myPromise = new Promise(function(resolve) {
    let req = new XMLHttpRequest();
    req.open('GET', "mycar.html");
    req.onload = function() {
      if (req.status == 200) {
        resolve(req.response);
      } else {
        resolve("File not Found");
      }
    };
    req.send();
  });
  document.getElementById("demo").innerHTML = await myPromise;
}

getFile();
Comment

PREVIOUS NEXT
Code Example
Javascript :: Datatable js Search Server side after time or word length 
Javascript :: how to map elements from 1st object react js 
Javascript :: hook use effect with class 
Javascript :: check notification permissopn allow or not 
Javascript :: JavaScript date format 2 
Javascript :: nodejs: send html file to show in Browser 
Javascript :: add filter category to react native flatslit 
Javascript :: HSETNX in redis 
Javascript :: Set A Function For An Element 
Javascript :: decimal to hex 
Javascript :: DataTables warning: table id=datatable - Ajax error 
Javascript :: javascript static methods 
Javascript :: sort function explained javascript 
Javascript :: sveltekit new app 
Javascript :: regex and 
Javascript :: javascript learning 
Javascript :: asp net core use newtonsoft json 
Javascript :: react native scrollview item bottom 
Javascript :: is multiple select javascript 
Javascript :: javascript remove the last element from array 
Javascript :: Auto increment in firebase realtime database 
Javascript :: best way to filter table in angular 
Javascript :: flatlist react native horizontal 
Javascript :: javascript array length 
Javascript :: input type for mobile number in react js 
Javascript :: document.addeventlistener 
Javascript :: discord js role giver 
Javascript :: how many edges in a complete graph with n nodes 
Javascript :: row append and calculation in jquery datatable 
Javascript :: js var part of var name 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =