Is it possible to take the content of a specific website url and display it in a Popup?

Asked

Viewed 101 times

0

I searched here on the site and found nothing about it.

Would it be possible to do that or is there already something like?

I would like that when entering my site search on another site an image or link and open on my site in the form of Popup.

Example: In a specific area of the Site "B" has an image, would it be like when entering the site "A" the popup of the site "A" searched the site "B" this image and displayed to the visitor in the form of Popup? I’m using as an example an image, but it can be any element.

  • To do yes, you have to load the page x and go through the elements of it until you find what you need, Voce can either open in some normal modal and load this page or you can create an iframe too, If you put an example of site loading content from site b I can even create something to demonstrate, here is an answer that already gives you a sense of where to start: http://answall.com/questions/121047/como-obtain-regi%C3%A3o-specifica-de-um-iframe/121057#121057

  • Thanks for replying, I created 2 simple websites for testing. Site B has 1 image http://sitebteste.blogspot.com.br/ and site A has nothing http://siteateste.blogspot.com.br/ . if you can show me how to make the image of site B appear on site A in popup form. see that I do not want the site to appear but only the image

1 answer

0

I believe an image is possible, as long as your site knows the URL of that image. But the content of an element is not. That would make navigation extremely insecure. Already imagined, if the site B were for example a social network, when you access the site A, it could request information from site B, and take all your data, contacts and other private things.

In computing, politics of the same origin is an important concept in web application security model. This policy allows scripts are executed on pages that originate from the same site - a combination of schema, host name and port number - to access each other’s DOM without specific restrictions, but prevents access to DOM on different websites. [1] This policy also applies to Xmlhttprequests unless the server provides a header Access-Control-Allow-Origin (CORS). Notably Websockets are not subject to the same origin policy.

Source: https://en.wikipedia.org/wiki/Same-origin_policy

Browser other questions tagged

You are not signed in. Login or sign up in order to post.