• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 378
  • Last Modified:

Enable Pop-up thry JavaScript in JSP Page -> Win SP2 + 3rd Party Pop-up Blockers

Hi!!

The problem is that i have a pop-up windows that gives some in information at time intervals on some condition.

The pop-up works fine under all versions of Netscape and IE 6.0, but under WIN XP SP2 and with 3rd Party Pop-up Blockers running in a system, the pop-up information window is closed as soon as it pop's-up.

Is there any workaround for this??

Tnx.
Vivek
0
vks_vicky
Asked:
vks_vicky
  • 7
  • 4
  • 3
  • +1
2 Solutions
 
CodingExpertsCommented:
Can you try doing window.open through javascript ???? coz i think that it wouldnot be blocked.

good luck
CodingExperts
0
 
TimYatesCommented:
>  Can you try doing window.open through javascript ???? coz i think that it wouldnot be blocked.

I think that is *exactly* what is blocked...

There is no way I can think of to get round this problem...  Windows that are popped up because of a mouse click somewhere should work ok, random popup windows with javascript will not work...

You may be able to detect that the window has been closed as soon as you do a "window.open" (by checking the window handle?) and display a message to the user telling them that they will have to "allow popups" for your site...

Or put a big warning message on the front page if there seems to be no way to detect the fact that windows have been blocked...

Tim
0
 
CodingExpertsCommented:
Hey Tim
In one of the application i have used window.open and directed it to a different jsp page but is not bocked

function callSubmit()
{
   w = open ("/newsletter/jsp/newsgenHTML.jsp?MonthReqd="+escape(document.xform.MonthReqd.options [document.xform.MonthReqd.selectedIndex].value)+"&YearReqd="+escape(document.xform.YearReqd.options[document.xform.YearReqd.selectedIndex].value),"winNewsLetter","width=600,height=600,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes");
   if (w.opener == null)
        w.opener = self;
   w.focus();
}
and this works pretty fine. I tried it with google/netscape7.2 popup blocker ??? why so ??
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
TimYatesCommented:
Odd...  I would have thought that would have been blocked...

Do you call "callSubmit" when something is clicked?  Or just when the page is loaded or after a delay?

If it's when something is clicked, can you try calling it in the onLoad method of the body tag?

Tim
0
 
CodingExpertsCommented:
You were right ... If "callSubmit"  is written onLoad it is blocked..

well well then i guess there is no way around to this problem not at least to what i know !!!!!!
Thanks Tim for correcting me ...

CodingExperts
0
 
TimYatesCommented:
:-)  *phew*

Basically, popup blockers spot popups which they think you didn't specifically ask for...

So they break this sort of functionality :-(

I don't know of any way to spoof them either, as if there were a way , advertising popups would use it...
0
 
vks_vickyAuthor Commented:
I've tried what u've done CodingExperts, it works fine as u've mentioned. But when a 3rd party Pop-up blocker or WinXP SP2 is loaded, it blocks, though an information is passed, still.

There is another way one could do it also, if u hold "Ctrl"+Refresh(F5), then the pop-up opens in Google, but still to try on WinXP SP2.

Vivek
0
 
vks_vickyAuthor Commented:
I found out that by holding down the ctrl button the windows opens.

One more point, on using a 3rd party pop-up blocker i have noticed that they block w.r.t web sites and have a database of sites, so since its an application rather than a website, it does not block.!!

But now is there a way to do it from Javascript i.e. Use CTRL down + Refresh
0
 
TimYatesCommented:
Is that a good solution?  How will your users know to do this?
0
 
KuldeepchaturvediCommented:
One more idea, I am not sure if this will work though...
java script has got a method names as ShowModelDialog() and showDialog()
To the user they work as a new window only.. but POP up blocker might be put off by using this method..

Just a guess...
0
 
vks_vickyAuthor Commented:
The idea would be to do it from within the application rather than ask the user to do that!! Tim.

Kuldeepchaturvedi, Dialog windows show messges and ask for a confirmation, but in my case:-

I have some value form mySQL database put into the windows and if the user is sure he know the proble, he acknowledges the each row displayed in the window and if it is not acknowledged, then the pop-up windows or information window is displayed again and again unless the problem is resolved or acknowledged!!!

Therefore Dialog window idea is not possible!!! That's the reason i wanted to know if there is a way to embed CTRL in the code when initiating the pop-up window.

My code looks something like this....

1) in index.jsp - i use
    window.open('abc.jsp?popup=true','vdnp','width=700,height=250,left=0,top=0,resizable=1,scrollbars=yes,status=yes');

2) and in abc.jsp - i do

<%
boolean popup = false;
if (request.getParameter("popup") != null)
popup =true;
%>

These line of code help me resolve when the Google's / Netscape's (7.x) Pop-up blocker are used, but in case of WinXP SP2, need work around!!

Vivek
0
 
TimYatesCommented:
> but in case of WinXP SP2, need work around!!

As I said before, I don't belive there is a workaround...  That's the point of Popup blockers...  They stop the advert popups, and advertisers would just use the workaround...

There are also many many blockers on the market...  From the one embedded in the Firefox browser, to the one that comes with the Kerio firewall, and many more...

You will never be able to sidestep them all... :-(

Tim
0
 
TimYatesCommented:
Instead of a popup, why don't you show the information on the main page in a panel or something?
0
 
vks_vickyAuthor Commented:
Tnx 4 all the help and sorry for the delay. Was out of town.
0
 
TimYatesCommented:
why the C grade?
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 7
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now