this post was submitted on 24 Oct 2023
2 points (100.0% liked)

HTML

309 readers
1 users here now

founded 1 year ago
MODERATORS
 

Hi,

I would like to display an element (div) of another web page, hosted on a owned sub domain..

I was planning to use iframe, but it seem that iframe only allow to grab the entire page... any ideas ?

Thanks.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 1 year ago

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/HTML_in_XMLHttpRequest

Grab the HTML. Slice up the DOM to get the div. Add to the page.

Probably want more than just the div. Might run into cross origin issues.