weird!! pop-up problem

J

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=yes,directories=no,status=yes,scrollbars=yes,menubar=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(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.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='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=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','no','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
 
V

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.
 
R

Randy Webb

VK said the following on 11/30/2005 4:08 AM:
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.
 
J

JJ

Randy Webb said:
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
 
J

JJ

VK said:
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
 
R

Randy Webb

Jasen Betts said the following on 12/2/2005 5:43 AM:
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.
 

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

No members online now.

Forum statistics

Threads
473,913
Messages
2,570,027
Members
46,421
Latest member
WaylonBran

Latest Threads

Top