_
_
_umr2017-01-10 00:07:47
PHP
_umr, 2017-01-10 00:07:47

How to make the functionality of inserting my code on the site to other people, how does VK do it?

How to make the functionality of inserting my code on the site to other people, how does VK do it? You need to send a post, not a video, but a straight post. Should I dig towards the iframe?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Konstantin   , 2017-01-19
@Umr001

You can send anything and anything (iframe, script, or data for an AJAX request), the main thing is that the server (your hosting) allows the use of data from other hosts.
By default, browsers are allowed to load scripts and images from other sources, but you can't make an AJAX request to servers that don't explicitly allow it. You can even load entire pages of other people in an iframe, but access to scripts from the main document to the contents of the iframe must be allowed using CORS.
More on the topic:
- https://habrahabr.ru/post/114432/
- https://developer.mozilla.org/en-US/docs/Web/HTML/...
- https://ru.wikipedia. org/wiki/Cross-origin_resource...
Google tags: crossorigin, CORS.
Another option is JSONP - loading data in the form of scripts from sources located on other hosts (servers with an address different from the address of the server of the calling page).
The most common solution for injecting third-party widgets is a script that drags data with it (inside the script body) and generates new markup, most often an iframe.
The mentioned oEmbed, in fact, does the same as the widgets "Vkontakte", "Facebook", etc.

R
riot26, 2017-01-10
@riot26

iframe or a piece of js that will make a request where necessary and display everything on the page

A
Alexander Taratin, 2017-01-10
@Taraflex

I am for standards
https://habrahabr.ru/post/141303/

P
profesor08, 2017-01-10
@profesor08

Create a separate page on your site with the necessary content to transfer to another site. Next, make an iframe and specify a link to that page in it. All.
If you manage to connect scripts, then you will have to try with the styles and names of identifiers and classes so that they cannot intersect with those that are already on the site. Next, use js to style the elements.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question