Fanboys on AV for Mac: "ludicrous" "a waste of time" "The Mac will protect me" "the most secure ever" "impenetrable" http://t.co/a1o2Sz7E
1 hour ago by defintel on twitter
ZDNet is available in the following editions:
Love or loathe it, a pop-up window is sometimes your best delivery mechanism. But if you are using pop-ups, you'll need a way to detect pop-up blockers. Here's how.
One possible solution is to have messages throughout your site saying something like, "This site utilizes pop-up windows. Please ensure that your pop-up blocker is disabled for this site." But that's not very user-friendly to make someone deactivate the blocker just to use your site. What's needed instead is a way to tell if a user has a pop-up block so that your site can then tailor the browsing experience.
Use a pop-up to kill a pop-up
The method that I've chosen to accomplish this task is by trying to open a pop-up window. Of course, this means that I have to be rather defensive in my programming because if I'm not, the possibility exists for the client seeing an error. With this in mind, I installed the Google Toolbar and began to code a page with an onload event handler that checks for pop-up blocking software. The results of this endeavor are shown in Listing A and Listing B.
The way that the page shown in Listing A works is that the onload event handler, setEvents, is fired and it attempts to open the page popupChild.html shown in Listing B. While it may seem that an error trap is enough to determine if the pop-up worked, that isn't always the case. Depending on the pop-up blocker installed there may or may not be an error. What's needed is essentially for the child window to stand up and say, "Hello, world!" or something along those lines. The page then uses the setTimeout method to delay the invocation of the function checkChild; this gives the pop-up the time needed to alter a hidden input object on the parent window and close itself. Once this has been accomplished, the function checkChild checks the value of the hidden input object to determine if the child window modified its contents. If the contents have changed, then the pop-up worked, which means no pop-up blocking software.
The two hardest parts of this entire testing process are accessing the hidden input object on the parent window and estimating how long it should take for the pop-up to open. The first problem is easily solved through the use of the Document Object Model's window.opener property. The second part is a lot harder; after all, as I play around with these examples the browser and the server are on the same machine. So while these examples worked for me, they might not work for everyone everywhere. There has to be a better way.
A better way
One of the interesting things about JavaScript is that, regardless of the browser, it is relatively consistent. If something works on one browser, the odds are that only a little tweak will be necessary to get it to work on another. For example, coding an alert with an object results in "[object]" in Microsoft Internet Explorer and "[object Window]" in Mozilla. Another interesting thing is that the aforementioned only happens when the object is actually created. The result of this line of reasoning is shown in Listing C. Note that because we're only checking to determine if a pop-up can be opened, it's merely an empty page.
One of the reasons that I developed this code is because, recently, several developers and technical support people spent three hours in a conference room dealing with this issue on our order entry system. A remote client insisted that they didn't have a pop-up blocker; only after having exhausted all possible problems on our end did someone suggest reviewing the client's installed programs. Near the bottom of that list was a program that added cute little smiles to the client's e-mails. After a little research it was determined that not only did it add smiles to e-mail, but among other things, it also blocked pop-ups. The user had installed a pop-up blocker and didn't even realize it, which is the problem that I'm trying to avoid in the future with this code.
Fanboys on AV for Mac: "ludicrous" "a waste of time" "The Mac will protect me" "the most secure ever" "impenetrable" http://t.co/a1o2Sz7E
1 hour ago by defintel on twitterRT @ameliatmy: the hottest angel investment & venture capital event in #MALAYSIA! will u be there? http://t.co/ChSjkmzu #ABAF
1 hour ago by seraphine on twitterSingapore Game Box in the ZDnet news!
http://t.co/UuTs0SqX http://t.co/YdPKmm39
RT @zdnetasia: SingTel acquires HungryGoWhere for US$9.4 million. http://t.co/Qho1REVZ
3 hours ago by molobok on twitterGartner: Mobile CRM gives better ROI than social - http://t.co/s5OfTAXK #CRM
3 hours ago by RichBohn on twitterRT @zdnetasia: S'pore sets up portal to grow games sector. http://t.co/In8gtj7L
3 hours ago by molobok on twitter#Malaysia: 20% yoy rise in overall #wages for both direct and non-direct labor. http://t.co/5T2e0LUU
3 hours ago by mikebuetow on twitterRT @mikebuetow: #Malaysia: 20% yoy rise in overall #wages for both direct and non-direct labor. http://t.co/5T2e0LUU
3 hours ago by PhotoStencilLLC on twitter@88tc88 RT @KevinZDNetAsia: User experience more important to app monetization than actual content http://t.co/ogbD5wyI… #li #dm12
3 hours ago by eelisam on twitterDubbed the first social #Olympics, this year's summer games have some of the strictest social rules for all involved http://t.co/4HlcqhW3
3 hours ago by 5Loom on twitterValue of big data analytics largely untapped - Zd Net http://t.co/ZuhPrCN4: Pushing cloud limits for d... http://t.co/VyOU0vHz #TheBIBlog
4 hours ago by nextbi on twitterValue of big data analytics largely untapped http://t.co/026PCpSc @zdnetasia
4 hours ago by data_nerd on twitterRT @data_nerd: Value of big data analytics largely untapped http://t.co/026PCpSc @zdnetasia
4 hours ago by alexandrearrigh on twitterActive WebTraffic - Downloads - ZDNet Asia: Active WebTraffic is a web promotion tool that includes ... http://t.co/fMJepPh8 #webtraffic
4 hours ago by Hits9auto on twitterSo much as we know , MTK6575 extremely integrated frequency1GHz ARM Cortex-A9 processor, the superiority of 3G / HSPA Modem, and help the...
14 hours ago by y15822137359 on 5 SaaS adoption speed bumps to avoidI reckon your view: "CRM is strategy, not software", if a company replicating the approach uses in ERP implementation into CRM, what they...
1 day ago by wykoong on Gartner: Mobile CRM gives better ROI than socialThis video will teach you about the Excel fill handle but also provide you with a workook to download... http://www.youtube.com/watch?v=...
2 days ago by TradeBrother on A quick fill handle trick for Microsoft Excelwaiting...
4 days ago by eapete on What should count in a company's market value?Boy, you've opened a can of worms now.
Wait for the rants & raves.
I was puzzling before this whether to replicate the success formula we executed for a financial institute, and come out with a standard s...
4 days ago by wykoong on Drop the egos, copy ideas, then innovateEchelon 2012 - The Awesomer Tech Event in Asia
Echelon 2012 – SEA’s longest running tech startup event goes Awesomer. Catch 50 of Asia’s most promising startups & over 40 international speakers on June 11-12.
Startup Asia Jakarta showcases new product-ready tech startups. Plus: hackathon, exhibition, and speakers. Use promo code CBSi50 for 50% discount.
ZDNet Asia Intelligent Singapore video series
Featuring inteviews with CXOs who define "intelligence" in their markets and reveal how their companies drive business efficiencies through ICT.