Good day!

I am again with a stupid question!

It means that I am going to make one system, say, it works according to the principle: the user clicks on the button, and the window.open method opens the window, and in this window some actions take place, for example, the values ​​are entered into the database or into the session; then this window should send a request to the page from which it opened it, the command, for example, to update the data on the page or, at worst, the command to refresh the page.

Tell me, please, how can this be realized? On the web sites, for example, this principle is made authorization through social networks!

  • nw.ucoz.com - right here, though I'm not talking about the pop-up window, I'm talking about window.open, described here javascript.ru/window-open - dantelol
  • I am also interested in this question. For example, I can give, Yandex Speller, who checks the text and in the new window offers options for correction. Here you can look at this: tech.yandex.ru/speller - Mr_Epic

2 answers 2

Can be done with the help of the so-called. ajax mechanism. To do this, use the class XMLHttpRequest. The Internet is full of tutorials.

  • I have there on the pages of the button mailruku vkontakte and facebook - depending on the button you clicked, windows.open opens and authorization by openapi occurs in this window and from this window the user data should be returned back to how this site will work What do you think? - dantelol
  • one
    Well, let's try to explain in a different way: then so "how can window.open return parameters to the page from which it was opened?" - dantelol
var w = window.open(null, null, "width=420,height=230"); w.document.write('<button onclick="window.opener.document.write(\'Ok\')">Send request</button>');