I have a javascript popup window with 2 hyperlinks in it. First link downloads a file, second link closes the window and returns to my site.
The question is, when the popup window gets closed, can I run a php script after that?
So something like:
[CODE]
<SCRIPT LANGUAGE=”JavaScript”>
function popitup2() {
newwindow2=window.open(”,’name’,’height=300,width=300,top=200,left=300′);
var tmp = newwindow2.document;
tmp.write(‘<html><head><title>My Site</title>’);
tmp.write(‘<link rel=”stylesheet” href=”js.css”>’);
tmp.write(‘</head><body><p>.</p>’);
tmp.write(‘<p><a href=”path/to/url”>view location</a>.</p>’);
tmp.write(‘<p><a href=”javascript:self.close()”>close</a> the popup.</p>’);
tmp.write(‘</body></html>’);
tmp.close();
}
</script>
</HEAD>
<BODY onLoad=”javascript:popitup2(”)”>
So I have it load up when the page gets loaded, but it there a way to run a script when I close this popup?
something like this:
[CODE]
<SCRIPT LANGUAGE=”JavaScript”>
function popitup2() {
newwindow2=window.open(”,’name’,’height=300,width=300,top=200,left=300′);
var tmp = newwindow2.document;
tmp.write(‘<html><head><title>My Site</title>’);
tmp.write(‘<link rel=”stylesheet” href=”js.css”>’);
tmp.write(‘</head><body><p>.</p>’);
tmp.write(‘<p><a href=”path/to/url”>view location</a>.</p>’);
tmp.write(‘<p><a href=”javascript:self.close([COLOR=Red]RUN PHP SCRIPT HERE[/COLOR])”>close</a> the popup.</p>’);
tmp.write(‘</body></html>’);
tmp.close([COLOR=Red] OR RUN PHP SCRIPT HERE[/COLOR]);
}
</script>
</HEAD>
<BODY onLoad=”javascript:popitup2(”)”>