26 Aug 2010

I came across a couple of problems with the StackTack jQuery plug-in today. I tried to use it with a more advanced Blogger template, but it would require a significant effort to rework the StackTack style sheet. As I just don’t have the necessary time to update the style sheet at the moment, I reverted to basic blue styled Blogger template. I then also noticed that StackTack was not displaying the question in IE8, and that there was a script error:

I looked at the relevant section of the (minimized) StackTack plug-in code and found that it was breaking on this IF statement:

if(e.indexOf(classTokens[0].toLowerCase())>-1){ ... }

Where e is a variable consisting of an array of strings. A quick Google took me to a StackOverflow question that indicated that Internet Explorer (including version 8) does not support the method indexOf onarrays.

The answer also indicated that adding a reference to the Prototype JavaScript library could resolve the issue. So I modified the includes statements in the header to be as follows: