how to close popup using javascript with xml formatting
- by Michael Robinson
I bought this program that created a pretty nice imageuploader flash script however I can't get the Javascript function close window to close the popup and redirect the original page.
here is the XML piece that defines the url's:
<urls urlToUpload="upload.php?" urlOnUploadSuccess="http://www.home.com/purchase.html"
urlOnUploadFail="http://www.home.com/tryagain.html"
urlUpdateFlashPlayer="http://www.home.com/flashalternative.html"
jsFunctionNameOnUpload=""/>
This last line calls a javascript function on upload. The problem is I don't know what to call and where to put it.
Here is the HTML file that is the popup:
<HEAD>
<title>Baublet Uploader</title>
<script type="text/javascript" src="swfobject.js"></script>
</HEAD>
<BODY>
<!-- Q-ImageUploader www.quadroland.com -->
<div id="QImageUploader">
Flash Player stuff here
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("q_image_uploader.swf", "imageuploader", "650", "430", "9", "#FFFFFF");
so.addParam("scale", "noscale");
so.addParam("salign", "TL");
so.addVariable("AdditionalStringVariable","pass additional data here");
so.write("QImageUploader");
// ]]>
</script>
I found this Closing script I thought might work:
<script language="javascript">
function close_window(page) {
window.opener.location.href=page
setTimeout(function(){window.close()},10);
}
</script>
Does this go into the Popup HTML page above or would it be a separate close.js file in the root?
Thanks,
I'm really confused.