(I’m not sure if “embedding” is the right word)
Im trying to embed a part of a webpage, so that when the site updates it, its also updated in my website.
Here’s a image if you don’t know what im talking about:
1 Like
First of all, that’s a very nice-looking website. So good job
I’m not sure about the question, are you using an iframe?
If so, you can use this to refresh the iframe:
document.getElementById('some_frame_id').contentWindow.location.reload();
Remember to keep an ID to your iframe, and replace “some_frame_id” to your actual ID
This is the recommended usage of this:
<button onclick="document.getElementById('some_frame_id').contentWindow.location.reload();
">Refresh results</button>
You can also use settimeout function, too
<script>
function refresh() {
document.getElementById('some_frame_id').contentWindow.location.reload();
setTimeout(function(){ refresh() }, 3000);
}
setTimeout(function(){ refresh() }, 3000);
</script>
4 Likes
Hello,
I haven’t decided if I should use a iframe or anything else.
I only want to know how I could embed a certain part of a webpage (See screenshot I sent before).