"PerlFAQ Server" <comdog@panix.com> wrote in message
news:9bKdnaAr78KScXjfRVn-gA@rogers.com...[color=blue][color=green]
>> index.html --
>> <html><head>
>> <script src="popup.js" type="text/javascript"></script>
>> </head><body>
>> <a href="#top" onclick="return(popup())">popup</a>
>> </body></html>
>>
>>
>> poped.html --
>> moomin
>>
>>
>> popup.js --
>> function popup() {
>> popupnewwindow = window.open( 'poped.htm', 'popme',
>> 'width=560, height=420, location=no, menubar=no,
>> status=no,' +
>> ' toolbar=no, scrollbars=auto, resizable=yes, left=200,
>> top=80'
>> );
>> return false;
>> }
>>
>>
>> Here, the popup will occur as a result of the onclick event. Provided
>> you actually click (or focus and press return) on it, the onclick is
>> user-initiated and *most* popup blockers will allow the new window to
>> be opened.
>>[/color]
>
> I know the trick you wrote here. It is working. However I did not see
> any of
> the onclick on sitepoint.com. I only see
> onclick="window.open('member.php?u=38110') onclick="who(284138);
> return
> false; etc. on the html page on
>
http://www.sitepoint.com/forums/show...5&page=1&pp=25
> Could you find how they did it? I could not repeat it.[/color]
Some sites have begun to implement Flash and Java components that cause
popups to happen. Many popup blockers can not contend with popups opened
by Flash or Java. However, many can, and changes are being made to
others to make them capable of blocking popups opened by Flash or Java.
However, in this case, it seems they've decided that lots of people
click on the Web browser window to do things like scroll, so their
source code includes:
window.onclick = popupfunction;
They also tie the popup to every link on the page with:
popupconvertlinks = function()
{
anch = document.getElementsByTagName('a');
for (i = 0; i < anch.length; i++)
{
if (!anch[i].onclick) anch[i].onclick = popupfunction;
}
}
Any click on the window (or any link) will trigger their logic which
generates an intermitant popup. So the popups that you see not being
stopped by the popup blocker are, in fact, user-initiated. It's just
that most users don't expect clicking in whitespace on the page to be
"user-initiated" (or cause a popup).
This can be confirmed by typing
"javascript
:void(alert(window.onclick));" into the Address Bar when
clicking anywhere in the window initiates a popup.
This is quite annoying and I'm surprised people who would stoop to this
haven't thrown a window.blur() in there as well, to force people to
click the window to give it focus.
--
Grant Wagner <gwagner@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq