Liam
Liam

Reputation: 9855

Share web page using Javascript/PHP on other websites

I have a website thats essentially a people directory.

Each person has a profile page, I want to somehow enabled other webmasters to take a link of code that they can paste on their websites and it will pull information of my page and format it in my brand colours etc, with a link back to my website. Is this possible or is an iframe the only way?

Upvotes: 0

Views: 101

Answers (1)

abhijit
abhijit

Reputation: 1968

You can do it in a iframe but comes with shortcomings, or you can use jquery/javascript to load the content from your site inside a div or some container at the remote site. But you would be facing some cross domain issues due to the common origin policy.

So you have explicitly define in your app to allow headers of origin you prefer, you can do that using JSONP or CORS, where jsonp only supports get request, cors is more appropriate way to do and supportallows any type of request.

CORS, to understand more Read this

Upvotes: 1

Related Questions