试图关闭一个窗口并打开一个没有工具栏的新窗口 [英] trying to close a window and open a new one without toolbars

查看:60
本文介绍了试图关闭一个窗口并打开一个没有工具栏的新窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




客户想要一个没有工具栏打开的窗口(技术和

''美学'的原因)窗口后,用户点击,正在关闭

.


我告诉他们浏览器中的安全设置,没有跨浏览器

解决方案和所有这一切我们都知道,但是他们告诉我他们已经看到了之前以及那些恼人的弹出窗口如何工作? 。 。 。


阅读和搜索后。 。 。我仍然没有看到如何获得它

正确


这就是我所拥有的(见下文)仍然提示你

消息:


您正在查看的网页正试图关闭窗口。


" ;你要关闭窗口吗?


" [YES | NO]"


// Page1_WithBrowswerToolbars.jsp

// - - - - - - - - - - - - - - - - - Page1_With Browswer工具栏


< html>

< head>

< title> Page1_WithBrowswerToolbars< / title>

< script type =" text / javascript" language =" Javascript">

<! -

function newWindow(popWin){

// __

window.opener = self;

window.close();

// __

popWindow = window.open(popWin ,''popWin'',

''width = 700,height = 600,resize = yes,toolbar = no,locati on = no,scrollbars = yes'');

popWindow.focus();

}

- >

< / script>

< / head>


< body bgcolor =" ffffff">

< center>< h1> Page1使用浏览器工具栏< / h1>

< br />

< br />

< a href =" javascript :newWindow(''。/ Page2_WithNoToolbars.jsp'')">点击

这里打开没有工具栏的窗口< / a>

< / center>

< / body>< / html>


// Page2_WithNoToolbars.jsp

// - - - - - - - - - - - - - - - - - Page2没有工具栏

< html>

< head>

< title> Page2_WithNoToolbars< / title>

< script type =" ;文本/ JavaScript的" language =" Javascript">

<! -

function CloseParent(){

var hwnd = window.open(' '', '' Page1_WithBrowswerToolbars ''); //通知,

没有包含页面,只有你想要劫持的窗口的标题

hwnd.close();

}

- >

< / script>


< / head>


< body onload =" CloseParent()">

< center>< h1> Page2_WithNoToolbars< / h1>< / center>

< / body>< / html>


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Hi,

client wants for a window with no toolbars to open (technical and
''esthetical'' reasons) after the window, user clicks on, is being
closed.

I told them about security settings in browsers and no cross-browsers
solutions and all of that we know, but they have told me they have
seen that before and how then the annoying pop-up windows work? . . .

After reading and searching . . . I still don''t see how to get it
right

This is what I have (see below) which is still prompts you with the
message:

"The Web page you are viewing is trying to close the window."

"Do you want to close the window?"

"[YES|NO]"

// Page1_WithBrowswerToolbars.jsp
// - - - - - - - - - - - - - - - - - Page1_With Browswer Toolbars

<html>
<head>
<title>Page1_WithBrowswerToolbars</title>
<script type="text/javascript" language="Javascript">
<!--
function newWindow(popWin){
// __
window.opener = self;
window.close();
// __
popWindow = window.open(popWin, ''popWin'',
''width=700,height=600,resize=yes,toolbar=no,locati on=no,scrollbars=yes'');
popWindow.focus();
}
-->
</script>
</head>

<body bgcolor="ffffff">
<center><h1>Page1 With Browser Toolbars</h1>
<br />
<br />
<a href="javascript:newWindow(''./Page2_WithNoToolbars.jsp'')">click
here to open window with no tool bars</a>
</center>
</body></html>

// Page2_WithNoToolbars.jsp
// - - - - - - - - - - - - - - - - - Page2 With No Toolbars
<html>
<head>
<title>Page2_WithNoToolbars</title>
<script type="text/javascript" language="Javascript">
<!--
function CloseParent(){
var hwnd = window.open('''',''Page1_WithBrowswerToolbars''); // notice,
no page included, only the title of the window you want to hijack
hwnd.close();
}
-->
</script>

</head>

<body onload="CloseParent()">
<center><h1>Page2_WithNoToolbars</h1></center>
</body></html>

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

推荐答案

2004年7月21日13:00:58 -0700,Albretch写道:


读入cljprogrammer
On 21 Jul 2004 13:00:58 -0700, Albretch wrote:

Read in c.l.j.programmer
客户想要一个没有工具栏的窗口打开


读者需要主题帖子

< script type =" text / javascript" language =" Javascript">
client wants for a window with no toolbars to open
reader wants on-topic posts
<script type="text/javascript" language="Javascript">




这不是。是什么让你觉得

Java程序员是否合格或能够获得JS问题?大多数Java程序员

甚至不会识别该行中的错误。


你会问面包师这个问题

你在你家的屋顶上?


< http://groups.google.com/groups?q = group:comp.lang.javascript>


将来,请不要将JS问题发布到cljp,

请不要交叉发布到三个小组(如果你是/ b $ b,这是奇妙的如果你可能那么重要 - 不,

你不是。)


F''Ups设置为cljs。

-

Andrew Thompson
http: //www.PhySci.org/ 开源软件套件
http://www.PhySci.org/codes/ Web& IT帮助
http://www.1point1C.org/ Science&技术



Which this is not. What makes you think
Java programmers are qualified or able
to abswer JS questions? Most Java programmers
would not even recognize the mistake in that line.

Would you ask the baker about that problem
you are having with the roof on your house?

<http://groups.google.com/groups?q=group:comp.lang.javascript>

In future, please do not post JS questions to c.l.j.p.,
please do not cross-post to three groups (in case you
were wonderring if you might be that important - no,
you are not).

F''Ups set to c.l.js.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology


Albretch说:
Albretch said:



客户想要一个没有工具栏的窗口用户点击窗口后,打开(技术和
'美学'的原因)正在关闭。

我告诉他们浏览器中的安全设置,没有交叉-browsers
解决方案以及我们所知道的所有内容,但是他们已经告诉我他们之前已经看过烦人的弹出窗口了吗? 。 。 。

Hi,

client wants for a window with no toolbars to open (technical and
''esthetical'' reasons) after the window, user clicks on, is being
closed.

I told them about security settings in browsers and no cross-browsers
solutions and all of that we know, but they have told me they have
seen that before and how then the annoying pop-up windows work? . . .




那些恼人的弹出窗口不能关闭原来的窗口。



Those annoying pop-up windows don''t close the original window.


Lee< RE ************** @ cox.net>在消息新闻中写道:< cd ********* @ drn.newsguy.com> ...
Lee <RE**************@cox.net> wrote in message news:<cd*********@drn.newsguy.com>...
那些恼人的弹出窗口不会关闭原始窗口。
Those annoying pop-up windows don''t close the original window.




好​​吧,实际上有些人这样做。



Well, actually some do.


这篇关于试图关闭一个窗口并打开一个没有工具栏的新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆