A
Adrian MacNair
I have a question in the child and I need to pass the answer back to the
parent:
var go = 0
var mywin = null;
opts = 'width=300,height=300,status=yes,toolbar=no,menubar=no,location=no'
mywin = window.open('','mywin',opts)
mywin.document.open()
mywin.document.write('<html><head><title>My Title</title>'
+'<script type="text/javascript">'
+'function sayyes() {'
+'go=1;'
+'window.close()'
+'}'
+'</script>'
+'</head><body>'
+'<p>Do you want to go or not?</p>'
+'<a href="#" onClick="sayyes()">Yes I do</a><br>'
+'<a href="#" onClick="window.close()">No I do not</a>'
+'</body></html>')
mywin.document.close()
if (go==1) {
do stuff
}
My problem is that the parent thinks var go is still 0 and doesn't get set
to 1. Any ideas?
parent:
var go = 0
var mywin = null;
opts = 'width=300,height=300,status=yes,toolbar=no,menubar=no,location=no'
mywin = window.open('','mywin',opts)
mywin.document.open()
mywin.document.write('<html><head><title>My Title</title>'
+'<script type="text/javascript">'
+'function sayyes() {'
+'go=1;'
+'window.close()'
+'}'
+'</script>'
+'</head><body>'
+'<p>Do you want to go or not?</p>'
+'<a href="#" onClick="sayyes()">Yes I do</a><br>'
+'<a href="#" onClick="window.close()">No I do not</a>'
+'</body></html>')
mywin.document.close()
if (go==1) {
do stuff
}
My problem is that the parent thinks var go is still 0 and doesn't get set
to 1. Any ideas?