In the first page I have
window.tmpstr = 'aaaaaa';
window.open ('second.php','_self',false);
in second.php
alert(window.opener.tmpstr)
This alerts 'undefined'. when I change '_self' to '_blank' it works. How can I pass the variable when I want the new window to open in the same window.
You can't, not like that. By calling
window.open
using_self
, you simply redirect the page to thesecond.php
url.Options you can use are :