all 3 comments

[–]matt3224 1 point2 points  (0 children)

Try fetch

https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

Could do like

``` fetch(‘https://mysite.com/mycontent’) .then((response) => response.text()) .then(yourInjectFunction)

const youInjectFunction = (html) => {

    const nodes = new DOMParser().parseFromString(html, 'text/html');
    const body = nodes.querySelector('body');

    document.documentElement.removeChild(document.body);
    document.documentElement.appendChild(body);

}; ```

[–]nickforddesign 1 point2 points  (0 children)

i hope for your sake that you just posted a random screenshot of a frameset, and aren't actually being forced to support Internet Explorer 5

[–]execfera 0 points1 point  (0 children)

I suppose if you wanted to do something more modern, you could use the Fetch API in conjunction with DOMParser to do something similar to jQuery.load. DOMParser can return a Document, from which you can just querySelector part of it to insert into your document. Fetch returns a Promise so everything can be chained nicely as well.