javascript中的对话框 [英] dialog box in javascript
本文介绍了javascript中的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨所有
i在webservice中创建.zip文件并允许用户使用此代码从javascript中查看打开,保存,取消窗口
hi all
i created .zip file in webservice and allow user to user to see "OPen , Save , Cancel" window from javascript using this code
function Export_Report_Sucess(result)
{
window.location.href(result);
}
但是当运行时,googleCrome和IE以外的其他浏览器没有显示窗口但是文件是成功下载
任何人都可以告诉我为什么以及如何解决这个问题
but when run this , googleCrome and the rest of browsers except IE didn't appear window however the file was downloaded sucessfully
can any one tells me why and how can i solve this
推荐答案
你好,
确保在服务器端代码中有以下行强制文件打开/保存为对话框。
Hello,
Make sure in your server side code you have following lines to force the file open/save as dialog.
//Add the file name and attachment, to force the open/save dialog to show
Response.AddHeader("Content-Disposition", "attachment;filename="+ FileName.Name);
//Add the file size into the response header
Response.AddHeader("Content-Length", (FileName.Length - startBytes).ToString());
还建议你通过这篇文章。
问候,
Also suggest you to go through this article here on CodeProject.
Regards,
您好,
首先,window.location.href不是函数。
使用:
Hello,
First, window.location.href is not a function.
Use this :
window.location.href = result;
这 [ ^ ]可能对您有所帮助。
This[^] might help you.
这篇关于javascript中的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文