By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,275 Members | 1,311 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,275 IT Pros & Developers. It's quick & easy.

weird!! pop-up problem

P: n/a
JJ

Dear all,

I have this weird problem on the website I maintain....
A few visitors seemed to be unable to XS the website. It has a front image,
with a link underneeth it saying: click here to continue.
The "click here to continue" line is a link, when people click on it, you
guess it: a pop up menu will apear...

The old script I used was:

<script LANGUAGE="JavaScript">
<!--
function DaanWindow1(wintype) {
SmallWin=window.open(wintype,"SmallWin","toolbar=y es,directories=no,status=yes,scrollbars=yes,menuba r=no,width=800,height=450");
SmallWin.window.focus() }
// -->
</script>
</HEAD>

<A HREF="javascript:DaanWindow1('html-menu.htm)">
After a couple of complaints, I changed it to:

<script language="javascript" type="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math .floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Mat h.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(scr een.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") ||
pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPositi on+',left='+LeftPosition+',scrollbars='+scroll+',l ocation=no,directories=no,status=no,menubar=no,too lbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>

with a link made:

<a href="html-menu.htm"
onclick="NewWindow(this.href,'daan','800','450','n o','center');return false"
onfocus="this.blur()"><font face="Verdana" size="1" color="#FFFFCC">...click
here to continue...</font></a>
And still a few visitors keep on saying:
"We are both using PC systems runing WindowsXP and Internet Explorer 6
browser. The first page opens, but when we click on the
link that says "click here to continue...." nothing happens."
Is there an alternative, compatible script available? Any help would be
gladly appriciated!

Regards
JJ


Nov 30 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
VK
> pop-up problem

The pop-up problem has been discussed here many times (search the posts
for "pop-up")

The problem is that any modern browser (including IE 6 starting with XP
SP2) has build in anti-popup activated by default.

Also nearly any anti-virus program has its own anti-popup also. In the
latter case IE cannot determine the popup state (its absence) and
crashes.

If your solution is not for intranet-only (so you cannot set each
station in the needed way) then you have to start to migrate
immediately on popup'less solution (iframe / div / browser state
snapshot). Otherwise approx. by the first middle of the next year your
site will be not functional for 90% of your visitors.

For the migration period you may use try-catch block to notify your
visitors:

try {
window.open(...);
}
catch (e) {
alert("Blocked by popup blocker");
}

If will fail on some *really old* browsers w/o try-catch support; but
it will fail on them anyway on the first attempt to address to that
imaginary window (which exists for the script, but it doesn't in the
reality). So you have nothing to loose but you have something to win.

Nov 30 '05 #2

P: n/a
VK said the following on 11/30/2005 4:08 AM:
pop-up problem

The pop-up problem has been discussed here many times (search the posts
for "pop-up")

The problem is that any modern browser (including IE 6 starting with XP
SP2) has build in anti-popup activated by default.


And it only blocks popups that are non user initiated. Clicking a link
that opens a new window will not invoke the popup blocker in IE6.
Also nearly any anti-virus program has its own anti-popup also. In the
latter case IE cannot determine the popup state (its absence) and
crashes.
Irrelevant but true.
If your solution is not for intranet-only (so you cannot set each
station in the needed way) then you have to start to migrate
immediately on popup'less solution (iframe / div / browser state
snapshot). Otherwise approx. by the first middle of the next year your
site will be not functional for 90% of your visitors.
For the migration period you may use try-catch block to notify your
visitors:

try {
window.open(...);
}
catch (e) {
alert("Blocked by popup blocker");
alert("For some reason, I couldn't open the window");

There are other reasons a window may not open besides a popup blocker.
}

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

Nov 30 '05 #3

P: n/a
JJ


"Randy Webb" <Hi************@aol.com> schreef in bericht
news:z5********************@comcast.com...

try {
window.open(...);
}
catch (e) {
alert("Blocked by popup blocker");


alert("For some reason, I couldn't open the window");

There are other reasons a window may not open besides a popup blocker.


Thanks for the messages.
But how can I solve this?

JJ

Nov 30 '05 #4

P: n/a
VK

JJ wrote:
Thanks for the messages.
But how can I solve this?


Depending on what are you using popups for. Different use - different
migration process.

Nov 30 '05 #5

P: n/a
JJ


"VK" <sc**********@yahoo.com> schreef in bericht
news:11*********************@g14g2000cwa.googlegro ups.com...

JJ wrote:
Thanks for the messages.
But how can I solve this?


Depending on what are you using popups for. Different use - different
migration process.


well, it's a frontpage with a photo.
underneeth the to photo stands a link: click here to continue.
the link is clickable and should open a window (800*450) where the entire
menu structure and site is placed in.

JJ

Nov 30 '05 #6

P: n/a
On 2005-11-30, Randy Webb <Hi************@aol.com> wrote:
The problem is that any modern browser (including IE 6 starting with XP
SP2) has build in anti-popup activated by default.

And it only blocks popups that are non user initiated. Clicking a link
that opens a new window will not invoke the popup blocker in IE6.


it's the same in mozilla.

It seems that user-initiated javascript has more
capabilities than system-event initiatef jsavsscript.

Thie means that if a ajax app wants to open another window (eg as a
non-modal dialogue) it can't do it from the asynchronous response :(

I guess I'll have to put the popup in a div...
--

Bye.
Jasen
Dec 2 '05 #7

P: n/a
Jasen Betts said the following on 12/2/2005 5:43 AM:
On 2005-11-30, Randy Webb <Hi************@aol.com> wrote:

The problem is that any modern browser (including IE 6 starting with XP
SP2) has build in anti-popup activated by default.

And it only blocks popups that are non user initiated. Clicking a link
that opens a new window will not invoke the popup blocker in IE6.

it's the same in mozilla.

It seems that user-initiated javascript has more
capabilities than system-event initiatef jsavsscript.


That is because too many sites decided that simply opening/closing the
page entitled them to spam the user with popups.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 3 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.