473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

onClick event and Pop-Up Blocking Software

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

Oct 17 '05 #1
13 2790
"crjunk" <cr****@earthlink.net> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
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


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>
Oct 17 '05 #2
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?


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
Oct 17 '05 #3
McKirahan said the following on 10/17/2005 2:56 PM:
"crjunk" <cr****@earthlink.net> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
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

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=".


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: 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
Oct 17 '05 #4
What if I decide not to use any type of javascript?
Does anyone know if using the following standard HTML would be
prevented by a pop-up blocker?
<a target="_blank" href="http://www.google.com">Google</a>

Thanks for everyone's help.

CR Junk

Oct 18 '05 #5
"crjunk" <cr****@earthlink.net> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
What if I decide not to use any type of javascript?
Does anyone know if using the following standard HTML would be
prevented by a pop-up blocker?
<a target="_blank" href="http://www.google.com">Google</a>

Thanks for everyone's help.

CR Junk


It's a hyperlink not a popup so it won't be blocked.
Oct 18 '05 #6
> It's a hyperlink not a popup so it won't be blocked.

By using a hyperlink and not a javascript, do you still have the
ability to remove the address bar and navigational tool bar from the
browser? Everything that I've searched for is using a javascript or the
window.open. I'm not sure what is the "best" solution when opening a
new browser.

I would prefer not having the address bar or toolbars displayed because
the report is automatically loaded as a PDF and I don't want my users
to have problems printing or saving the pdf. It seems like a lot of
the time users will try to use the web browser's "File > Print" or
"File > Save" options instead of using the Acrobat Reader tool bar.

Thanks,
CR Junk

Oct 18 '05 #7
crjunk said the following on 10/18/2005 2:37 PM:
It's a hyperlink not a popup so it won't be blocked.

That depends, directly, on the quality of the popup blocker and the
user's intelligence.

By using a hyperlink and not a javascript, do you still have the
ability to remove the address bar and navigational tool bar from the
browser?
No, but you never had the ability to do that to my browser to begin with.
Everything that I've searched for is using a javascript or the
window.open. I'm not sure what is the "best" solution when opening a
new browser.
The "best" solution is not to do it at all. Let the user decide whether
they want a new window or not. They know better what they want than you do.
I would prefer not having the address bar or toolbars displayed because
the report is automatically loaded as a PDF and I don't want my users
to have problems printing or saving the pdf.
First, it is not "automatically loaded as a PDF" in the browser unless
you have explicit control over every browser that can open the page. It
is a user setting.

It seems like a lot of the time users will try to use the web browser's
"File > Print" or "File > Save" options instead of using the Acrobat
Reader tool bar.


Has it occured to you that maybe they *like* doing it that way?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 18 '05 #8
> The "best" solution is not to do it at all. Let the user decide whether
they want a new window or not. They know better what they want than you do.
Actually, I have to have a new window because if the PDF is loaded in
the user's browser and then the user clicks on the back button, they
will receive a "Warning: Page has Expired " error.
First, it is not "automatically loaded as a PDF" in the browser unless
you have explicit control over every browser that can open the page. It
is a user setting.
This is primarily an intranet application, so for the most part, we can
usually control the browser setting.
Has it occured to you that maybe they *like* doing it that way?


The report is displayed in frames. In the top frame are hyper links to
3 different PDF reports. The bottom panel displays the PDF. If the user
clicks on File > Save, then the browser will try to save the HTML. I
don't want to constantly have phone calls and walk users through the
proper way to save their report.

Thanks,

CR Junk

Oct 19 '05 #9
crjunk said the following on 10/19/2005 9:35 AM:
The "best" solution is not to do it at all. Let the user decide whether
they want a new window or not. They know better what they want than you do.

Actually, I have to have a new window because if the PDF is loaded in
the user's browser and then the user clicks on the back button, they
will receive a "Warning: Page has Expired " error.


Ok, fair enough.
First, it is not "automatically loaded as a PDF" in the browser unless
you have explicit control over every browser that can open the page. It
is a user setting.

This is primarily an intranet application, so for the most part, we can
usually control the browser setting.


Then why can't you "usually control the browser setting" with regards to
popup blockers?
Has it occured to you that maybe they *like* doing it that way?

The report is displayed in frames. In the top frame are hyper links to
3 different PDF reports. The bottom panel displays the PDF. If the user
clicks on File > Save, then the browser will try to save the HTML. I
don't want to constantly have phone calls and walk users through the
proper way to save their report.


<a href="howToSaveTheReports.html">Directions to save Reports</a>

In your top frame.

Educate your users. It will save you many many headaches.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 19 '05 #10
crjunk wrote:
The "best" solution is not to do it at all. Let the user decide whether
they want a new window or not. They know better what they want than you
do.


Actually, I have to have a new window because if the PDF is loaded in
the user's browser and then the user clicks on the back button, they
will receive a "Warning: Page has Expired " error.


So your design decision is merely based on the unfounded assumption
that users have the Adobe Acrobat Reader plugin installed.
PointedEars
--
Alcohol and Math don't mix. So please don't drink and derive!
Oct 20 '05 #11
> So your design decision is merely based on the unfounded assumption
that users have the Adobe Acrobat Reader plugin installed.

My design decision is based on what the boss and my supervisor wants. I
can't always have it my way. He writes the check! :)

Oct 20 '05 #12
Randy Webb said following :
Then why can't you "usually control the browser setting" with regards to popup blockers?

Upper management gets more lenient treatment with what they can and
cannot do on their computer.
<a href="howToSaveTheReports.html">Directions to save Reports</a> In your top frame. Educate your users. It will save you many many headaches.


I'll give that a try. What happens when they don't read the
directions? :) Oh well, can't win them all.

Thanks!
CR Junk

Oct 20 '05 #13
crjunk said the following on 10/20/2005 9:20 AM:
Randy Webb said following :
Then why can't you "usually control the browser setting" with regards to


popup blockers?

Upper management gets more lenient treatment with what they can and
cannot do on their computer.

<a href="howToSaveTheReports.html">Directions to save Reports</a>


In your top frame.


Educate your users. It will save you many many headaches.

I'll give that a try. What happens when they don't read the
directions? :) Oh well, can't win them all.


The same thing that happens when your uppwer management gets lenient
treatment that prevents your "solution" from working otherwise. The
difference is that in the event they don't read the directions, they
call you on the phone and you can say "Open the report page. See the
'Save Reports' link? Read it".

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 20 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andreas Knollmann | last post by:
Hi, I create an object like this: var cell = document.createElement("td"). It doesn't have to be cell. I want this cell to use the onclick event. What doesn't work in the IE as well as with...
2
by: Todd Cary | last post by:
Currently, I have a Link to show a PDF file <? print('Click <a href="' . $url . $sfyc_race_schd_send . '" Name="Race Schedule" Target="_blank">here</a> to open the Race Schedule'); ?> I want...
2
by: RobG | last post by:
I am trying to dynamically add an onclick to an element, however I just can't get the syntax right. consider the following function: function doClick (evt,x) { // do things with evt and x } ...
4
by: masantha wee | last post by:
Hi all, I am using Firefox and embedding Javascript in html. I understand that we can use mouse events by coding them in the body of html (by creating a button or anything and by adding in the...
17
by: abs | last post by:
My element: <span onclick="alert('test')" id="mySpan">test</span> Let's say that I don't know what is in this span's onclick event. Is it possible to add another action to this element's onclick...
4
by: RobG | last post by:
I have a function whose parameter is a reference the element that called it: function someFunction(el) { ... } The function is assigned to the onclick event of some elements in the HTML...
5
by: moondaddy | last post by:
I have a <a> element in a datagrid which wraps some asp.net labels. this element also has an onclick event which does not fire in netscape 6 (and perhaps other browsers for all I know...). Below...
5
by: kai | last post by:
Hi, In ASP.NET , what is the difference between OnClick and Click events for a button? Because we have button click event, it can trigger events, why we still need OnClick? Please help. ...
7
by: extremerep | last post by:
My task is to change the value of a button and then make it functional with the onClick handler. Changing the value to "Play Again" works, but making the onClick work accordingly does not. The...
5
by: Bob | last post by:
The title says it all. The nextmon() and prevmon() functions are listed afterward, since they call fDrawCal().I'm sure you see the problem...prevmon() is not defined prior to being mentioned in the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.