Skip to content

Unknown function _popupControl()

Sep 29, 2009 1 min read #javascript

This post is more than 18 months old. Technology changes quickly, so some of this content may be out of date (but that's not always the case). Please verify any technical or programming information against the current release.

In my Javascript Error Handler post, I discussed how I track user and client side errors. Recently, my error logs became inundated with tons of javascript errors. The function _popupControl() is undefined. After a little googling, I found out that the CA Personal Firewall is responsible for inserting the following code into every page:

<script type="text/javascript">_popupControl();</script>
html

Well, for whatever reason, that software is no longer providing that function to the page. Not sure about the inner workings. My concern is that Internet Explorer is generating a popup error on the page, however. This would make it look like my page is erroring out. Or even worse, it may stop other scripts.

I’ve implemented a work around, and I’m curious how well it will work. My javascript now includes this code:

if (typeof _popupControl != 'function') {
  var _popupControl = function() {};
};
javascript

This script simply checks to see if the _popupControl() function is defined. If it is not, it assigns it to an anonymous function that does nothing. Curious to see if this will work…