how to close popup using javascript with xml formatting

Posted by Michael Robinson on Stack Overflow See other posts from Stack Overflow or by Michael Robinson
Published on 2010-04-16T02:22:13Z Indexed on 2010/04/16 2:33 UTC
Read the original article Hit count: 407

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about Xml