onClick事件和弹出窗口阻止软件 [英] onClick event and Pop-Up Blocking Software
问题描述
如果他们有任何弹出窗口阻止工具,我是否应该期望我的某些用户无法查看我在新的网络浏览器中启动的报告
他们的电脑上安装了酒吧或其他软件?
< input type =" button" value ="查看此位置的MPR"
onClick =" javascript :popUp(''''http://MyServer/MPR_Report/ViewReport.aspx?fn = 12345'''')">
谢谢,
CR Junk
Should I expect some of my users to not be able to view a report that I
am launching in a new web browser if they have any popup blocking tool
bars or other software installed on their computer?
<input type="button" value="View MPR For This Location"
onClick="javascript:popUp(''''http://MyServer/MPR_Report/ViewReport.aspx?fn=12345'''')">
Thanks,
CR Junk
推荐答案
" crjunk" < CR **** @ earthlink.net>在消息中写道
news:11 ********************* @ g43g2000cwa.googlegro ups.com ...
"crjunk" <cr****@earthlink.net> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
我是否应该期望我的一些用户无法查看我在新的网络浏览器中启动的报告,如果他们的计算机上安装了任何弹出式阻止工具栏或其他软件?
< input type =" button" value ="查看此位置的MPR"
onClick =" javascript :popUp(''''http://MyServer/MPR_Report/ViewReport.aspx?fn = 12
345'''')">
谢谢,
CR Junk
Should I expect some of my users to not be able to view a report that I
am launching in a new web browser if they have any popup blocking tool
bars or other software installed on their computer?
<input type="button" value="View MPR For This Location"
onClick="javascript:popUp(''''http://MyServer/MPR_Report/ViewReport.aspx?fn=12
345'''')">
Thanks,
CR Junk
为什么你在函数调用中使用了两个撇号而不是一个撇号?
如何设置" location.href ="?
以下是两个变体你的方法。
变异#1:" javascript :"不需要。
变体#2:使用" location.href ="。
< html>
< head>
< title> nopopup.htm< / title>
< script type =" text / javascript">
function popUp (网址){
提醒(网址);
}
< / script>
< / head>
< body>
< form action ="" method =" get">
< input type =" button" value ="查看此位置的MPR"
onClick =" javascript :popUp(''http://MyServer/MPR_Report/ViewReport.aspx ?fn = 123
45'')">
< br>
< input type =" button" value ="查看此位置的MPR"
onClick =" popUp(''http://MyServer/MPR_Report/ViewReport.aspx?fn = 12345'')">
< br>
< input type =" button" value ="查看此位置的MPR"
onClick =" location.href =''http://MyServer/MPR_Report/ViewReport.aspx?fn = 12345''
">
< / form>
< / body>
< / html>
Why did you use two apostrophes instead of just one in the function call?
How about just setting "location.href="?
Below are two variations of your approach.
Variation #1: "javascript:" is not required.
Variation #2: uses "location.href=".
<html>
<head>
<title>nopopup.htm</title>
<script type="text/javascript">
function popUp(url) {
alert(url);
}
</script>
</head>
<body>
<form action="" method="get">
<input type="button" value="View MPR For This Location"
onClick="javascript:popUp(''http://MyServer/MPR_Report/ViewReport.aspx?fn=123
45'')">
<br>
<input type="button" value="View MPR For This Location"
onClick="popUp(''http://MyServer/MPR_Report/ViewReport.aspx?fn=12345'')">
<br>
<input type="button" value="View MPR For This Location"
onClick="location.href=''http://MyServer/MPR_Report/ViewReport.aspx?fn=12345''
">
</form>
</body>
</html>
crjunk在2005年10月17日下午2:43发表以下内容:
crjunk said the following on 10/17/2005 2:43 PM:
我是否应该期望我的一些用户无法查看我在新的网络浏览器中启动的报告,如果他们的计算机上安装了任何弹出式阻止工具栏或其他软件?
Should I expect some of my users to not be able to view a report that I
am launching in a new web browser if they have any popup blocking tool
bars or other software installed on their computer?
绝对毫无疑问。
即使用户发起的点击,你也不能总是得到弹出窗口的
。 />
Norton的弹出窗口拦截器是我想到的第一个。它用虚拟函数替换了
window.open所以它*不能打开一个新窗口。
-
Randy
comp.lang.javascript常见问题 - http://jibbering.com/faq &新闻组每周
Absolutely and without a doubt.
Even with user-initiated clicks, you are not always assured of getting
that pop-up window.
Norton''s popup blocker is the first that comes to mind. It replaces
window.open with a dummy functions so it *cant* open a new window.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
McKirahan在2005年10月17日下午2:56发表以下内容:
McKirahan said the following on 10/17/2005 2:56 PM:
" crjunk" < CR **** @ earthlink.net>在消息中写道
新闻:11 ********************* @ g43g2000cwa.googlegro ups.com ...
"crjunk" <cr****@earthlink.net> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
我是否应该期望我的一些用户无法查看我在新的网络浏览器中启动的报告,如果他们的计算机上安装了任何弹出式阻止工具栏或其他软件?
< input type =" button" value ="查看此位置的MPR"
onClick =" javascript :popUp(''''http://MyServer/MPR_Report/ViewReport.aspx?fn = 12
345'''')">
Should I expect some of my users to not be able to view a report that I
am launching in a new web browser if they have any popup blocking tool
bars or other software installed on their computer?
<input type="button" value="View MPR For This Location"
onClick="javascript:popUp(''''http://MyServer/MPR_Report/ViewReport.aspx?fn=12
345'''')">
谢谢,
CR Junk
Thanks,
CR Junk
为什么你在函数调用中使用了两个撇号而不是一个撇号?
如何设置" location.href ="?
以下是你的方法的两种变体。
变体#1:" javascript :"不需要。
变体#2:使用" location.href ="。
Why did you use two apostrophes instead of just one in the function call?
How about just setting "location.href="?
Below are two variations of your approach.
Variation #1: "javascript:" is not required.
Variation #2: uses "location.href=".
网站都不应考虑这两种情况。
< html>
< head>
< title> nopopup.htm< / title>
< script type =" text / javascript"> ;
功能popUp(网址){
提醒(网址);
}
< / script>
< / head>
< body> ;
< form action ="" method =" get">
< input type =" button" value ="查看此位置的MPR"
onClick =" javascript :popUp(''http://MyServer/MPR_Report/ViewReport.aspx?fn = 123
45'')">
Neither of which should be considered for a Web site.
<html>
<head>
<title>nopopup.htm</title>
<script type="text/javascript">
function popUp(url) {
alert(url);
}
</script>
</head>
<body>
<form action="" method="get">
<input type="button" value="View MPR For This Location"
onClick="javascript:popUp(''http://MyServer/MPR_Report/ViewReport.aspx?fn=123
45'')">
javascript :在任何非IE浏览器中都不需要,它只是在一些情况下需要
IE。放弃它。
< a href =" ViewReport.aspx?fn = 12345">没有Javascript的报告< / a>
为什么人们试图让事情变得比他们更难?
-
兰迪
comp。 lang.javascript常见问题 - http://jibbering.com/faq &新闻组周刊
javascript: is not needed in any non-IE browser and it is only needed in
IE in a few circumstances. Drop it.
<a href="ViewReport.aspx?fn=12345">The Report with NO Javascript</a>
Why do people try to make things harder than they have to be?
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
这篇关于onClick事件和弹出窗口阻止软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!