获取错误:在 JavaScript 中的 window.open() 函数上访问被拒绝
getting an error:Access is denied on window.open() function in javascript
我在打开文件时遇到问题。这是我的javascript代码:
<script language="javascript" type="text/javascript">
var refViewer = null;
function OpenViewerWindow(image) {
alert(image)
return window.open("file:///E:/HOBBYHOMES_E-PORTFOLIO/HobbyHomesWebApp/ePortfolio/PortFolioContent/5/ReferenceMaterial/"+image, "Viewer", "height=400px,width=550px,menubar=no,scrollbars=yes ,resizable=yes,top=100px,left=234px");
}
function openViewer(image) {
if (refViewer != null) {
if (refViewer.closed == false) {
refViewer.close();
refViewer = OpenViewerWindow(image);
}
else refViewer = OpenViewerWindow(image);
}
else
refViewer = OpenViewerWindow(image);
}
</script>
@item.candidate portfolo.FilePath 包含文件名:prtf_1.docx
但我的文件没有打开。在Internet Explorer中,我收到Accesdened错误。
在Mozilla Firfox中,它无法打开
我是否指定了错误的路径。请帮助我
您无法通过浏览器访问本地文件,除非您具有特殊权限,或者您在本地运行页面(即使这样,它也无法跨浏览器可靠地工作)
除非您使用 HTML5 文件 API http://www.html5rocks.com/en/tutorials/file/dndfiles/
YMMV 但此注册表设置适用于我公司的 Web 应用程序,用于打开本地(下载)的 Word 文档:
[HKEY_CURRENT_USER'Software'Microsoft'Windows'CurrentVersion'Internet Settings'Lockdown_Zones'0]
"2101"=dword:00000000
相关文章:
- javascript函数访问ios本机功能
- 从嵌套函数访问函数属性
- 将typescript函数访问到angular中
- 全局变量只能由第一个函数访问
- Javascript从匿名函数访问外部对象属性
- UI网格:如何从自定义函数访问MODEL_COL_FIELD
- 在jQuery中,我如何从$.ajax回调函数访问$(this)
- 如何在JavaScript中停止从特定函数访问某些函数和变量
- 从jQuery.ech()函数访问外部作用域
- Angular2/Typescript:从链接可观察函数访问实例变量
- 局部变量仍可通过函数访问
- 从Kendo中的columns.filterable.cell.template函数访问列字段名
- 可以't从JS函数访问combodate
- 如何在javascript中将变量从一个函数访问到另一个函数
- jQuery从PHP函数访问Ajax响应
- 如何从json函数访问javascript中的基类变量
- 在OPP JS中,您可以从构造函数访问原型函数内部声明的方法
- Javascript 使用函数访问其他类
- 从 JavaScript 中的私有函数访问公共函数
- 为什么我无法从茉莉花中的 javascript 函数访问全局变量