[COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]现在windows.open默认都是新开标签,不是新窗口.所以指定不了高和宽的.
下面资料自己看看
<script[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(255, 0, 0)][BGCOLOR=transparent][SIZE=14px]type[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"text/javascript"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]>[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 139)][BGCOLOR=transparent][SIZE=14px]function[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] open_new_window[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]URL[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px])[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]{[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(43, 145, 175)][BGCOLOR=transparent][SIZE=14px]NewWindow[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] window[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px].[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]open[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]URL[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px],[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]"_blank"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px],[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]"toolbar=no,menubar=0,status=0,copyhistory=0,scrollbars=yes,resizable=1,location=0,Width=1500,Height=760"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px])[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px];[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(43, 145, 175)][BGCOLOR=transparent][SIZE=14px]NewWindow[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px].[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]location [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] URL[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px];[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]}[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]</script>
[/SIZE][/BGCOLOR][/COLOR]
[P][LINE-HEIGHT=18px][ALIGN=left][FACE=Arial, ][COLOR=rgb(0, 0, 0)][BGCOLOR=rgb(255, 255, 255)][SIZE=14px]window.open() will not open in new tab if it is not happening on actual click event. In the example given the url is being opened on actual click event. [B][B][BGCOLOR=transparent][SIZE=14px]This will work provided user has appropriate settings in the browser[/SIZE][/BGCOLOR][/B][/B].[/SIZE][/BGCOLOR][/COLOR][/FACE][/ALIGN][/LINE-HEIGHT][/P][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]<a[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(255, 0, 0)][BGCOLOR=transparent][SIZE=14px]class[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"link"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]>[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]Link[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]</a>[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px][/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]<script[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(255, 0, 0)][BGCOLOR=transparent][SIZE=14px]type[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"text/javascript"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]>[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] $[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]"a.link"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]).[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]on[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]"click"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px],[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 139)][BGCOLOR=transparent][SIZE=14px]function[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px](){[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] window[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px].[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]open[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]'www.yourdomain.com'[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px],[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]'_blank'[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]);[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]});[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px][/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]</script>[/SIZE][/BGCOLOR][/COLOR][P][LINE-HEIGHT=18px][ALIGN=left][FACE=Arial, ][COLOR=rgb(0, 0, 0)][BGCOLOR=rgb(255, 255, 255)][SIZE=14px]Similarly, if you are trying to do an ajax call within the click function and want to open a window on success, ensure you are doing the ajax call with async : false option set.[/SIZE][/BGCOLOR][/COLOR][/FACE][/ALIGN][/LINE-HEIGHT][/P][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]<a[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(255, 0, 0)][BGCOLOR=transparent][SIZE=14px]href[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"#"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(255, 0, 0)][BGCOLOR=transparent][SIZE=14px]onClick[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]open_new_window[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]'http://www.google.com'[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]);[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]>[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]google search[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]</a>[/SIZE][/BGCOLOR][/COLOR]