链接为:http://www.uniea.com/images_index/for-iphone.asp代码为:<script type="text/javascript">
<!--
function runSave(){
if (saveImg.location != "about:blank")window.saveImg.document.execCommand("SaveAs");
}
function saveImgAs(url){
if(window.saveImg && url)window.saveImg.location=url;
}
//-->
</script><input type="submit" value="download" onclick="saveImgAs('images/bigpic_iphone/<%=rs("bigpic")%>')"><iframe src="about:blank" name="saveImg" onload="runSave()" style="display:none;"></iframe>
<!--
function runSave(){
if (saveImg.location != "about:blank")window.saveImg.document.execCommand("SaveAs");
}
function saveImgAs(url){
if(window.saveImg && url)window.saveImg.location=url;
}
//-->
</script><input type="submit" value="download" onclick="saveImgAs('images/bigpic_iphone/<%=rs("bigpic")%>')"><iframe src="about:blank" name="saveImg" onload="runSave()" style="display:none;"></iframe>
ff 中得到某个element 用document.getElementBy();
另外,ff中可以用firebug调式O.o
document.getElementBy(saveImg).contentWindow.document.execCommand这样的话在ff中和Ie都可以执行了,不过ff和ie某些还是有差别的。
做兼容不容易O.o