471,120 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,120 software developers and data experts.

popup blocker blocks javascript

Hi guys

I am trying to prepare few html pages which contain OLAP cubes on a CD. The problem I have is that the popup blocker blocks the OLAP modules from being shown. Therefore, I wanted to write script that will check if the popup blocker is enabled and tell the user to allow the site. I tried my own scripts and after several tries I looked for better scripts on the web. I ended up with this one but the problem is the same.
[HTML]<script type="text/javascript" language="JavaScript">
<!--

function detectPopupBlocker() {
var myTest = window.open("about:blank","","directories=no,heigh t=100,width=100,menubar=no,res izable=no,scrollbars=no,status=no,titlebar=no,top= 0,location=no");
if (!myTest) {
alert("A popup blocker was detected.Please allow this program to continue.");
} else {
myTest.close();
alert("No popup blocker was detected.");
}
}
window.onload = detectPopupBlocker;
//-->
</script>[/HTML]

the JAVASCRIPT DOESN"T RUN WHEN THE POPUP BLOCKER IS ON. Therefore, it is not able to tell the user to allow the site. But the script works perfectly it the blocker is off! its show the message there is no popup blocker.(What's the use!). When the popup blocker is on, even a simple alert('Test!') doesn't run. Please Helpppppppppppp.
The other related question I have, Can I allow all the CD to be allowed by the popup bloker rather than on a page basis.
Hope to find the solution
Yisehaq
Feb 14 '07 #1
6 1797
acoder
16,027 Expert Mod 8TB
Use the other way round, i.e. test for myTest, e.g. try the following:
Expand|Select|Wrap|Line Numbers
  1. function detectPopupBlocker() {
  2. var myTest = window.open("about:blank","","directories=no,height=100,width=100,menubar=no,res   izable=no,scrollbars=no,status=no,titlebar=no,top=   0,location=no");
  3. if (myTest) {
  4. myTest.close();
  5. alert("No popup blocker was detected.");
  6. } else {
  7. alert("A popup blocker was detected.Please allow this program to continue.");
  8. }
  9. }
  10. window.onload = detectPopupBlocker;
This works in Firefox.
Feb 14 '07 #2
thanks
but it doesn't work either. It's not only this script that doesn't work. Even a simple alert() kept at the head tag doesn't work. But when I open the script on the site I took from works. Not on my pages?!!!
Feb 14 '07 #3
acoder
16,027 Expert Mod 8TB
Create a dummy page which only contains simple Javascript. Does it work? If not, you may need to check your browser settings. If it does work, there is a problem with the code on your page.
Feb 14 '07 #4
Create a dummy page which only contains simple Javascript. Does it work? If not, you may need to check your browser settings. If it does work, there is a problem with the code on your page.
The script works when the popup blocker is disabled or the page/file is allowed. Otherwise, it doesn't ?
Feb 15 '07 #5
The script works when the popup blocker is disabled or the page/file is allowed. Otherwise, it doesn't ?
okay now I found something. the browses "Allow active content to run in files on My Computer" was not clicked when I select that the script will run.

Now my problem is that I am going to run the pages from CD. Can I make a prompt to the user to modify this without going through all the menus.

I check on other application CD and it has prompt that asking you to modify this.

"Active content can harm your computer or disclose personal information. Are you sure that you want to allow CDs to run active content on you computer?"

how can I prompt the user when the CD autorun?
Feb 15 '07 #6
acoder
16,027 Expert Mod 8TB
This is a Windows/Microsoft/IE problem. One workaround is to use shellRun for your CD. See this link.
Feb 16 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

13 posts views Thread by dave yan | last post: by
38 posts views Thread by Shaun McKinnon | last post: by
8 posts views Thread by Bijoy Naick | last post: by
2 posts views Thread by QA | last post: by
26 posts views Thread by Raffi | last post: by
9 posts views Thread by Rathtap | last post: by
7 posts views Thread by anthony.turcotte | last post: by
7 posts views Thread by rob c | last post: by
4 posts views Thread by vickeybird | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.