0

I'm using vanilla Ajax. I've just loaded the second html page via the first one. In the second one, there are two rows of "script src". No one of it has been loaded. Is there any reason for that?

function loadPage(url) 
{
    let Request = new XMLHttpRequest();
    let content = document.getElementsByTagName('main')[0];

    Request.onreadystatechange = () => {
        if (Request.readyState == 4 && Request.status == 200) {
            content.innerHTML = Request.responseText;
        }
        else if (!Request) {
            alert('Lalala');
        }
    }

    Request.open('GET', url);
    Request.send();
}

P.S. Please, advise me resolve without JQuery. THANKS!

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
user8661184
  • 43
  • 1
  • 6

0 Answers0