How can I capture the HTML from a link in JavaScript? Alternatively, for a more conversational tone: W

20 Replies, 1415 Views

You could also try the `XMLHttpRequest` way if `fetch` isn’t cooperating:

```javascript
var xhr = new XMLHttpRequest();
xhr.open('GET', 'your-url', true);
xhr.onload = function() {
console.log(xhr.responseText);
};
xhr.send();
```

Old-school but works when `fetch` acts up.

Messages In This Thread



Users browsing this thread: 1 Guest(s)