點選按鈕開啟圖片儲存為對話框的範例如下 複製程式碼 程式碼如下: 程式碼如下: New Document script> <BR><script language="JavaScript"> <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="_doSaveAsImloadm." ="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>function _doSaveAsImage(){ <BR>if(document.all._SAVEASIMAGE_TEMP_FRAME.src!="about:blank") <BR>document.frames("_SAVEASIMAGE_TEMPank") <BR>document.frames("_SAVEASIMAGE_TEMPave_A).docum ; <BR>} <BR>//--> <BR>