单击按钮打开图片另存为对话框的示例如下 复制代码 代码如下: New Document <BR><!-- <BR>function downLoadImage(imagePathURL){ <BR>//如果中间IFRAME不存在,则添加 <BR>if(!document.getElementById("_SAVEASIMAGE_TEMP_FRAME")) <BR>jQuery('<iframe style="display:none;" id="_SAVEASIMAGE_TEMP_FRAME" name="_SAVEASIMAGE_TEMP_FRAME" onload="_doSaveAsImage();" <BR>width="0" height="0" src="about:blank">').appendTo("body"); <BR>if(document.all._SAVEASIMAGE_TEMP_FRAME.src!=imagePathURL){ <BR>//图片地址发生变化,加载图片 <BR>document.all._SAVEASIMAGE_TEMP_FRAME.src = imagePathURL; <BR>}else{ <BR>//图片地址没有变化,直接另存为 <BR>_doSaveAsImage(); <BR>} <BR>} <BR>function _doSaveAsImage(){ <BR>if(document.all._SAVEASIMAGE_TEMP_FRAME.src!="about:blank") <BR>document.frames("_SAVEASIMAGE_TEMP_FRAME").document.execCommand("SaveAs"); <BR>} <BR>//--> <BR>