Is it possible to get a value from a popup window? Additionally I would like to use JS and HTML only, i.e. no PHP. Is this even possible? I\'ve seen other posts on here like thi
It works for me (using Firefox 20.0). But the code is really ugly and old though, probably you should study the present standards of MSDN Window to understand how it works in firefox (Window object may change its behaviour in other browsers). Ah, and of course the ECMAScript . But to introuduce one of the multiple solutions, you could try this:
parent.html
<input type="text" id="output"/>
<button id="show">Open</button>
<script>
document.getElementById('show').addEventListener('click', function(){
window['output'] = document.getElementById('output');
window.open('map.html')
});
</script>
maps.html (I changed the extension!)
<input type="text" id="user_text"/>
<input id="send" type='button' value'send'/>
<script>
document.getElementById('send').addEventListener('click', function(){
window.opener['output'].value = document.getElementById('user_text').value;
})
</script>