BBC Site and Popup Blockers

B

Bijoy Naick

It seems like the BBC sports site is able to get past popup blockers..
For eg.. http://news.bbc.co.uk/sport1/hi/cricket/default.stm. Click on
the Video icon under "Watch and Listen" - right hand frame.

I have a popup blocker installed but the window still pops up.. Any
one know how this can be done?

BTW: I need this functionality for an intranet application.

Bijoy
 
G

Grant Wagner

Bijoy said:
It seems like the BBC sports site is able to get past popup blockers..
For eg.. http://news.bbc.co.uk/sport1/hi/cricket/default.stm. Click on
the Video icon under "Watch and Listen" - right hand frame.

I have a popup blocker installed but the window still pops up.. Any
one know how this can be done?

BTW: I need this functionality for an intranet application.

Bijoy

There's no magic going on. Most friendly/sophisticated popup blockers do
not block popups that are a direct result of some action by the human user
sitting in front of the Web browser. In the case of the site you included,
they are simply doing:

<a href="#" onClick="javascript:launchAVConsoleStory('3803753')">

which is wrong by the way, it should probably be:

<a href="#" onClick="launchAVConsoleStory('3803753');return false;">

Presumably launchAVConsoleStory() contains a call to window.open(). Most
popup blockers are quite happy to honor window.open() if it's in a
function that's called directly from the onclick event of a link (most
popup blockers begin to have problems if you call a function that calls a
function that calls window.open()).

If you are using popup blockers are that are so agressive they suppress
user-generated popups, then I'd suggest you change to a more
friendly/sophisticated popup blocker.

So all you need is something like:

<a href="myUrl.asp" target="customWindowName"
onclick="return openWindow(this, 'height=200,width=200');">

<script type="text/javascript">
function openWindow(lnk, attributes) {
if (!lnk.target) {
lnk.target = 'defaultWindowName';
}
window.open(
lnk.href,
lnk.target,
attributes
);

return false;
}
</script>

Neither the Google toolbar popup blocker nor Firefox have any problems
opening the new window requested above.
 
R

Randy Webb

Bijoy said:
It seems like the BBC sports site is able to get past popup blockers..
For eg.. http://news.bbc.co.uk/sport1/hi/cricket/default.stm. Click on
the Video icon under "Watch and Listen" - right hand frame.

I have a popup blocker installed but the window still pops up.. Any
one know how this can be done?

BTW: I need this functionality for an intranet application.

Let me get this straight:

Its an Intranet
You have no control over the settings on the computers.
You want to know how to defeat the popup blockers.

You and every other popup spammer on the web.
 
H

Hywel

Let me get this straight:

Its an Intranet
You have no control over the settings on the computers.

If it's an Intranet it's very likely that the OP has control over the
settings on the computers.
 
R

Randy Webb

Hywel said:
If it's an Intranet it's very likely that the OP has control over the
settings on the computers.

That was my point. The whole question of defeating a popup blocker
seemed suspicious to me. Maybe it was innocent, maybe it was just the
results of me reading too many "how do I defeat popup blocker" questions.
 
G

Grant Wagner

Dennis M. Marks said:
1. The popup is blocked in Netscape on my computer.

What version of Netscape? Mozilla 1.7.1 and Firefox 0.9.2 allow the window
to open. Earlier versions of Mozilla (on which Netscape is based) may indeed
be buggy and refuse to open the window. If that is the case, you will need
to upgrade to a newer version of Netscape, or use Mozilla instead.

It's also possible you are running some "Internet security" software such as
Norton that is being overly aggressive and removing all occurrances of
window.open(). Again, if this is the case, you need to disable this
software, or disable the functionality that is causing the problem.

It's also possible someone has changed the default configuration of your
copy of Netscape to disallow *any* new windows from being opened.
2. I believe that this type of popup should not be stopped since it is
being requested by the user. I want my popup blocker to stop automatic
popups with ads at open and close, etc, not requested windows that are
showing site content.

As I've stated, Mozilla and Firefox in their default configuration, and IE
with the Google toolbar installed all allow the window to open because it is
user initiated

I don't think the popup blocking mechanism in Mozilla ever suffered from the
problems you describe, so it's unlikely it's a bug in Netscape inherited
from an earlier version of Mozilla. I'm betting you've got some other
software (Norton Internet Security, Window Washer, etc) or a configuration
change that is causing this problem.

<script type="text/javascript">
function openWindow(lnk) {
window.open(lnk.href, 'windowName','height=400,width=400');
return false;
}
</script>
<a href="http://www.yahoo.com" onclick="return openWindow(this)">Yahoo</a>

The above code should work to open a new window reliably in the default
configuration of the newest Netscape, Mozilla, Firefox, Camino and Internet
Explorer with the Google toolbar installed. If the above code is not
working, the solution is not to find a "workaround", the solution is to
determine why it is not working for you and either change that
configuration, or change your design to not require new windows to be
opened.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top