JavaScript Popup Chrome #39;save as#39;-deactivated? Why?(JavaScript Popup Chrome“另存为已停用?为什么?)
问题描述
我正在用 Javascript 打开一个弹出窗口:
I am opening an popup in Javascript with:
function popup(title,w,h,site) {
x = screen.availWidth/2-w/2;
y = screen.availHeight/2-h/2;
var date = new Date()
var ticks = date.getTime();
var popupWindow = window.open(
title,"popup"+ticks,'width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+',resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,titlebar=yes,hotkeys=yes,status=yes,dependent=no,location=1');
popupWindow.document.write(site);
return popupWindow;
}
当我右键单击新窗口时,另存为"对话框在 chrome 中被停用.
When I right click the new window, the "save as"-dialog is deactivated in chrome.
如何启用它?我做错了什么?
How can I enable it? What am I doing wrong?
推荐答案
属性 status
应该是 1
而不是 yes
.这应该是阻止 Chrome 将弹出窗口视为新窗口的原因.
the attribute status
should be 1
not yes
. This should be what is preventing Chrome from treating the popup as a new window.
另外,open()
按以下顺序接受参数:
Also, open()
takes parameters in this order:
window.open(URL,name,specs,replace)
那就试试吧:
window.open("about:blank", title, 'width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,titlebar=yes,hotkeys=yes,status=yes,dependent=no,location=1')
这篇关于JavaScript Popup Chrome“另存为"已停用?为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:JavaScript Popup Chrome“另存为"已停用?为什么?


基础教程推荐
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01