Jump to content


Photo

popup blocker detection


  • Please log in to reply
5 replies to this topic

#1 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 21 October 2006 - 01:40 PM

Since one is required to begin testing with IE7 i've came across only one "problem" so far - IE7 seems to have a slightly stricter popup blocker as default compared to the default setting in IE6.
One one of my sites i have a drop down menu that sets off a new window via javascript onchange. In FF,Opera and IE6 this was no problem but IE7 now stops this new window from launching.

Any good solutions on a blocker alert (preferrably cross browser) so i can explain users what happened and how to allow pop ups on my site?

#2 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 21 October 2006 - 10:01 PM

How about something like this.

function openWindow(url) {
    if (window.open(url,'name','height=200,width=150')) {
       doSomething(); 
   } else {
        alert('You will have to set your popup blocker to allow popups to see this..or whatever');
   }
}


Is that what you were wanting?

Good Luck,
Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#3 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 22 October 2006 - 06:20 AM

well, i've been testing something similar - the problem is that in the moment IE blocks content it seems to be stopping all scripts, so any custom message to the user never appears.... and thats where the challenge is.

In the end the best would be to remove the dropdown-launch and do another twist i guess, but still a block message could be handy in some cases.

#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 22 October 2006 - 09:18 PM

Could you not do the reverse? Have it off by default, and then add the dropdown if you do find pop-ups allowed?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#5 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 23 October 2006 - 04:28 AM

Yeah, thats true - i do however hate having to do things more than one way on my sites ... and i really couldn't settle with the blocked solution anyhow, so i removed the dropdown and replaced it by a style-"hidden" html menu instead. Then the text-links triggers the popup and its not blocked by default settings.

#6 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 23 October 2006 - 04:37 AM

That is what I do..

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users