Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > popup blocker

Reply
Thread Tools

popup blocker

 
 
jimmygoogle
Guest
Posts: n/a
 
      10-16-2007
I am trying to get a site with a form on it to open a new window
(once) when any element of the form has focus.

The function I am using on page load causes the popup blocker to be
triggered. However, if I set the onfocus in the form element (onfocus
= loadWindow() - everything works as it should (no popup blocker).
Anyone know how to do this without going through each form element and
putting the onfocus code in there?

function setHandlers() {

var inputs = document.getElementsByTagName("input");

for (var i = 0 ; i < inputs.length ; i++){

//blocked by popup blocker
inputs[i].onfocus = function(){loadWindow();}

//causes the page to try to load the window
for each form element
//inputs[i].onfocus = loadWindow();

}

}

 
Reply With Quote
 
 
 
 
jimmygoogle
Guest
Posts: n/a
 
      10-17-2007
On Oct 16, 8:46 pm, Randy Webb <HikksNotAtH...@aol.com> wrote:
> jimmygoogle said the following on 10/16/2007 5:23 PM:
>
> > I am trying to get a site with a form on it to open a new window
> > (once) when any element of the form has focus.

>
> Bad idea.
>
> > The function I am using on page load causes the popup blocker to be
> > triggered.

>
> Hmmm. User sets focus, window opens, user closes unwanted popup, input
> field regains focus, window opens, repeat annoyance factor.
>
> Bad idea again. And, that is assuming the window even opens to start with.
>
> Rethink your design, it is fatally flawed and doomed as it is.


The window is opened underneath the current window only once thats
it. It cannot be opened more than one time. Granted it is annoying
it is what my project calls for.
>
> --
> Randy
> Chance Favors The Prepared Mind
> comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
> Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/



 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      10-17-2007
jimmygoogle wrote:
> The window is opened underneath the current window only once thats
> it.


Firefox has a default preference to prevent this.

> It cannot be opened more than one time.


Iff it can be opened.

> Granted it is annoying


And leaking memory, at least on Windows.

> it is what my project calls for.


It isn't.


PointedEars
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sites which pass the Mozilla Popup Blocker joe Firefox 34 04-13-2005 04:45 PM
Firefox gamed - Drudge getting around Firefox popup blocker Venger Firefox 10 12-22-2004 04:37 AM
FF 1.0 Popup blocker Kneewax Firefox 2 11-22-2004 06:36 PM
How to open a popup when popup blocker is turned on Ashish Javascript 2 10-31-2004 07:00 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57