Javascript window.open忽略宽度/高度参数
我无法打开特定大小的弹出窗口 看看 我尝试使用的js是:Javascript window.open忽略宽度/高度参数,javascript,Javascript,我无法打开特定大小的弹出窗口 看看 我尝试使用的js是: window.open('http://www.google.com', 'toolbar = 0', 'scrollbars = 1', 'statusbar = 0', 'menubar = 0', 'resizable = 0', 'height = 500', 'width = 433'); 哪里出错了?所有选项都在同一个字符串参数中: $('.my-link').click(function (e) { e.pre
window.open('http://www.google.com', 'toolbar = 0', 'scrollbars = 1', 'statusbar = 0', 'menubar = 0', 'resizable = 0', 'height = 500', 'width = 433');
哪里出错了?所有选项都在同一个字符串参数中:
$('.my-link').click(function (e) {
e.preventDefault();
window.open('http://www.google.com', 'WindowName','toolbar = 0, scrollbars = 1, statusbar = 0, menubar = 0, resizable = 0, height = 500, width = 433');
});
所有选项都位于同一字符串参数中:
$('.my-link').click(function (e) {
e.preventDefault();
window.open('http://www.google.com', 'WindowName','toolbar = 0, scrollbars = 1, statusbar = 0, menubar = 0, resizable = 0, height = 500, width = 433');
});
使用此语法
$('.my-link').click(function (e) {
e.preventDefault();
window.open(
/* Url */
'http://www.google.com',
/* Window Name */
'',
/* Options */
'toolbar=0,scrollbars=1,...,height=500,width=433');
});
例如:
window.open接受url、windowName和选项作为参数。
选项定义为逗号分隔的单个字符串
可在上获得更多参考,请使用此语法
$('.my-link').click(function (e) {
e.preventDefault();
window.open(
/* Url */
'http://www.google.com',
/* Window Name */
'',
/* Options */
'toolbar=0,scrollbars=1,...,height=500,width=433');
});
例如:
window.open接受url、windowName和选项作为参数。
选项定义为逗号分隔的单个字符串
更多参考可在带有逗号的单独stringnot参数上找到
例如:
window.open('http://www.google.com', 'My window', 'toolbar=0,scrollbars=1,statusbar=0,menubar=0,resizable=0,height=500,width=433');
用逗号分隔stringnot参数
例如:
window.open('http://www.google.com', 'My window', 'toolbar=0,scrollbars=1,statusbar=0,menubar=0,resizable=0,height=500,width=433');
实际上,窗口名不能在“windowName”内有任何空格实际上,窗口名不能在“windowName”内有任何空格