开发者

how to close popup using javascript with xml formatting

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.


It looks like that bit of script belongs to the popup. It changes the parent window's location and then closes itself after a ~10ms delay. The function close_window most likely is being called by the Flash applet.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜