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:
1: <script src='http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js' type='text/javascript'/>
2: <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>
3: <script src='http://app.stacktack.com/jquery.stacktack.min.js' type='text/javascript'/>
This allowed the plug-in to correctly work in IE8. I created a new issue against the plug-in on BitBucket. You can view screenshots of my blog on browsershots.org – a great tool for web developers.