• When a theme/plugin uses prototype.js and “Track Names” is on, JavaSCript error occurs:

    Error: ca[i].indexOf is not a function

    The problem is that for (var i in something) without any checks is not safe with Prototype as it extends Arrays with its own methods.

    Here’s the patch that solves this issue:

    --- clicky.orig/clicky.php	(original)
    +++ clicky/clicky.php	(patched)
    @@ -404,7 +404,8 @@
     	<script type='text/javascript'>
     	function clicky_gc( name ) {
     		var ca = document.cookie.split(';');
    -		for( var i in ca ) {
    +		var len = ca.length;
    +		for( var i=0; i<len; ++i ) {
     			if( ca[i].indexOf( name+'=' ) != -1 )
     				return decodeURIComponent( ca[i].split('=')[1] );
     		}

    Hope that helps.

    http://wordpress.org/extend/plugins/clicky/

  • The topic ‘Clicky Prototype = JavaScript error’ is closed to new replies.