var downloadLink = document.getElementById('downloadFileLink');
downloadLink.onclick = Function("location.href='DownloadHandler.ashx?fileName=" + fileName + "&filePath=" + filePath + "'");
downloadLink.style.display = 'block';
downloadLink.style.display.visibility = 'hidden';
//downloadLink.onclick(); //this sentence can't run in firefox
if (document.all && typeof (document.all) == "object") //IE
{
downloadLink.fireEvent("onclick");
}
else {
var e = document.createEvent('MouseEvent');
e.initEvent('click', false, false);
downloadLink.dispatchEvent(e);
}
return false;
2009-10-12
Javascript onclick IE Firefox
發佈者: 香港818 於 10/12/2009
訂閱:
發佈留言 (Atom)
0 留言:
發佈留言