Cross Domain Return Popup

This is the setting:

I have two websites in two different domains:

  • www.website1.com
  • www.someotherwebsite.com

This is what I want to do:

  • When the user is on www.website1.comand clicks on the link, I want the popup to show www.someotherwebsite.com.

  • When the user clicks a button in a popup window (showing www.someotherwebsite.com), I want this window to close and the return value.

  • I want the value to be returned from a popup that needs to be placed (in a div, or in a javascript call, or somewhere accessible, for example, filling out a form field) on www.website1.com.

Hope this makes sense. I need to use only HTML and Javascript without external libraries. It should also work with current major browsers (i.e. Do not be HTML5).

Thank you in advance for your help.

+3
source share
2 answers

Well, if you use an iframe in your popup [on this day in age, I would avoid pop-ups like the plague due to pop-up blockers]

With iframe you can make cross-domain calls

Why don't you just create a web service from A to B and name it A? It seems a lot cleaner than finding small cracks in browsers to circumvent security.

+3
source

www.someotherwebsite.com www.website1.com. , GET JavaScript. JavaScript - , opener.document.getElementById, - opener.document.doSomething(val); .

(, ?) , , - , , .

+2

Source: https://habr.com/ru/post/1718008/


All Articles