body onunload仅用于外部链接 [英] body onunload for external links only

查看:69
本文介绍了body onunload仅用于外部链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户离开

网站时,是否有人有示例代码显示弹出窗口?我真的不想使用这种技术,但客户

要求它。


我在想像un body onunload,catch他们的URL是

链接并解析它为我们自己网站的网址,只有当他们不同时才显示流行

。 />

任何人都有该代码的样本?谁知道这是一个糟糕的

技术?我愿意接受建议。


谢谢,


Don

解决方案

在文章< 11 ********************* @ c13g2000cwb.googlegroups中。 com>,
bb*****@hotmail.com 写道:

有没有人有示例代码在用户离开
网站时显示弹出窗口?我真的不想使用这种技术,但是客户要求它。




当你关闭窗口时,现代浏览器不允许弹出窗口。


告诉他们Windows SP2允许用户阻止弹出窗口。


您可以实现自己的关闭按钮来执行弹出窗口。几天后询问你的

客户是否还在使用你的关闭按钮或

浏览器的关闭按钮。


为什么您的客户想要这样做?也许有更多的客户以友好的方式做他们想做的事。


几年前,我经常光顾这个游戏网站。当我离开网站时,他们弹出了窗口弹出窗口。每次你离开一个窗口,你都会得到一个或两个以上的b $ b。我不得不重新启动电脑才能离开网站。我停止了访问该网站的
,直到我得到一个带弹出窗口拦截器的网络浏览器。


Robert


< blockquote> bb*****@hotmail.com 写道:

任何人都有示例代码,以便在用户离开
网站时显示弹出窗口?我真的不想使用这种技术,但客户要求它。


然后教育你的客户他们想要的愚蠢。

我在想像un body onunload,抓住他们的URL
链接并解析它为我们自己的网站的网址,只有当它们不同时才显示流行



如果我在地址栏中输入网址,您如何建议捕获该网址?你好吗<
不能。


现在,如果我在网站的第1页,我的收藏夹中有第14页,

和我点击收藏夹(在IE中)转到那个页面,你有绝对的* b $ b *没有*方式知道我去了哪里。现在,我是否获得弹出窗口或

?我离开了网站。通过不点击页面中的链接,但我没有
离开网站。

任何人都有该代码的样本?有人知道这是一种糟糕的技术吗?我愿意接受建议。




它不是很糟糕,它是愚蠢的。


-

Randy

comp.lang.javascript常见问题 - http: //jibbering.com/faq


是的,我呃...感谢人们花时间回应。


我特意解释说我不想这样做,但

的客户要求它。功能要求是一种谈判。

说我需要教育有钱包的人是

充其量只是业余爱好者。我可以在最后的支票中教育他们

这项工作。任何控制客户要求的开发人员都会使用低级应用程序或者过着迷人的生活。


我正在编写基于的代码onunload,但我很感激

回复。


Don


Randy Webb写道:

bb*****@hotmail.com 写道:

当用户离开
网站时,是否有人有示例代码显示弹出窗口?我真的不想使用这种技术,但是客户要求它。
然后教育你的客户愚蠢他们想要的东西。

我正在考虑像un body onunload这样的东西,抓住他们链接到的URL并为我们自己网站的网址解析它,如果他们是的话,只显示
弹出不同。



如果我在地址栏中输入网址,你如何建议抓住网址?



你不能。

现在,如果我在网站的第1页,我的收藏夹中有page14,
我点击收藏夹(在IE中)转到该页面,你有
绝对*没有*知道我去哪里的方法。现在,我得到弹出窗口还是没有?我离开了网站。通过不点击页面中的链接,但我
没有离开网站。

任何人都有该代码的样本?有人知道这是一种糟糕的技术吗?我愿意接受建议。



它不是很糟糕,它很愚蠢。

-
Randy
comp .lang.javascript常见问题 - http://jibbering.com/faq




does anyone have sample code to display a pop up when a user leaves the
site? I really don''t want to use this technique, but the clients
demand it.

I''m thinking something like un body onunload, catch the URL they''re
linking to and parse it for our own site''s url and only display the pop
up if they''re different.

anyone have a sample of that code? anyone know if it''s a lousy
technique? I''m open to suggestions.

thanks,

Don

解决方案

In article <11*********************@c13g2000cwb.googlegroups. com>,
bb*****@hotmail.com wrote:

does anyone have sample code to display a pop up when a user leaves the
site? I really don''t want to use this technique, but the clients
demand it.



Modern browsers do not allow a popup when you close the window.

Tell them that Windows SP2 allows the user to block pop windows.

You could implement your own close button that does a popup. Ask your
customer in a few days whether they are still using your close button or
the browser''s close button.

Why does your customer want to do this? Maybe there is a more customer
friendly way of doing what they want.

I a few years back, I frequented this gaming site. They put popup
windows when I left the site. Every time you left a window, you got one
or two more. I had to reboot the pc to get out of the site. I stopped
visiting the site until I got a web browser with a popup blocker.

Robert


bb*****@hotmail.com wrote:

does anyone have sample code to display a pop up when a user leaves the
site? I really don''t want to use this technique, but the clients
demand it.
Then educate your clients to the stupidity of what they want.
I''m thinking something like un body onunload, catch the URL they''re
linking to and parse it for our own site''s url and only display the pop
up if they''re different.
How do you propose catching the URL if I type it in the address bar? You
can''t.

Now, if I am on page1 of the site, and I have page14 in my favorites,
and I click the favorites (in IE) to go to that page, you have
absolutely *no* way to know where I went. Now, do I get the popup or
not? I left the "site" by not clicking a link in the page, yet I didn''t
leave the site.
anyone have a sample of that code? anyone know if it''s a lousy
technique? I''m open to suggestions.



It''s not lousy, its stupid.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq


yeah, I uhh... appreciate that people took the time to respond.

I made a point of explaining that I didn''t want to do this, but the
clients demanded it. Functional Requirements are a negotiation.
Saying that I need to "educate" the people with the purse strings is
amateurish at best. I could educate them right out of the final check
for this work. Any developer who controls their client''s requirements
is either working with low level apps or leading a charmed life.

I am writing the code based on onunload, but I do appreciate the
responses.

Don

Randy Webb wrote:

bb*****@hotmail.com wrote:

does anyone have sample code to display a pop up when a user leaves the site? I really don''t want to use this technique, but the clients
demand it.
Then educate your clients to the stupidity of what they want.

I''m thinking something like un body onunload, catch the URL they''re
linking to and parse it for our own site''s url and only display the pop up if they''re different.



How do you propose catching the URL if I type it in the address bar?


You can''t.

Now, if I am on page1 of the site, and I have page14 in my favorites, and I click the favorites (in IE) to go to that page, you have
absolutely *no* way to know where I went. Now, do I get the popup or
not? I left the "site" by not clicking a link in the page, yet I didn''t leave the site.

anyone have a sample of that code? anyone know if it''s a lousy
technique? I''m open to suggestions.



It''s not lousy, its stupid.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq




这篇关于body onunload仅用于外部链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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