Thomas Gent
Thomas Gent

Reputation: 1

Copying image and link onto another website

I have 2 websites, i have an image with a link on both websites i want to make it so when one of those images and links is changed the other on the other website changes also, is this possible in anyways?

Upvotes: 0

Views: 92

Answers (1)

Marc
Marc

Reputation: 746

Your best options would be:

a) Use ajax to pull in the content on both sites, for example with jQuery:

<div id="linked-image"></div>
<script>
$('#linked-image').load('https://www.yoursite.com/file-with-your-html.html');
</script>

b) Use an iframe on both sites, both of which use a common src attribute:

<iframe src="https://www.yoursite.com/file-with-your-html.html"></iframe>

c) Use an API call to retrieve the image src and link href from a common endpoint source, and then load to both sites dynamically

Upvotes: 3

Related Questions