Solution for PrettyPhoto Error: Object doesn’t support this property or method jquery-1.6.1.min.js, line xx character xxxxx
This is an issue using PrettyPhoto on a WordPress blog for IE7/IE8
Object doesn’t support this property or method jquery-1.6.1.min.js, line xx character xxxxx
The solution follows…
The issue in detail
I use PrettyPhoto in several posts throughout my site as well as other plug-ins.
Using IE8 and going through my blog as a user would, if I came across an image which used the PrettyPhoto plug-in everything would work as expected. Everything was fine except under certain conditions which took me a while to isolate.
It caused me grief to no end for days. The reason for my inability to properly identify the issue was twofold.
- I was using tabbed browsing and failed to realize that for some reason the error was crashing some of the functionality of the browser instance which loaded the script so that going back to a post which had previously worked no longer did anything; even after loading other tabs.
- I thought the problem was with the lightbox itself as everything else worked as usual and from a cursory perspective the issue seemed to appear at random.
It seemed the lighbox script never loaded completely and all functionality on the page failed. The page displayed correctly but nothing was clickable afterwards. Instead of opening in a lightbox the image would just open in the current page (_self.) If I went back to a previous post using the browser’s back button, previously viewed posts (in the current session) which had been proven to work no longer did.
I didn’t want to get rid of the lightbox plug-in as I like its ease of use so I downloaded and installed the latest version.
The obvious thing to do here is start disabling plug-ins.
Closer inspection using the IE developer tools yielded a call from SyntaxHighlighter for the JQery version installed on the system. This however, was not my primary suspect.
The first suspect was a related links plugin I’ve been experimenting with.
No luck… Enabled the plug-in again.
Since the SyntaxHighlighter plug-in was already in my radar I disabled it.
Success, it was the SyntaxHighlighter which was somehow conflicting with my lightbox.
After much back n forth it became clear that when the plug-in crashed the browser instance itself, not just the current tab but all of the tabs loaded in a particular browser instance would no longer run scripts. If I spawned another window, not a tab but a window (as a new process thread). That browser window would function perfectly until I attempted to view lightboxed images in the culprit postings again.
There’s also this: The lighboxex were previously confirmed to work. In the last few weeks there was an update for SyntaxHighlighter which we did through the WP admin automatic update utility. We didn’t go back to check the postings as there was no overt indication of a problem. So it is quite probable that the last update to the plug-in introduced the issue.
I decided to go to the plug-in creator’s page to look for any kind of solution or at least make some kind of a report to the plug-in developer. Unfortunately for me I visited his page using IE 8 (since I was already working with it) and fell victim to some kind of rancid script on his webpage that attempts to keep you from leaving. Or at least that’s what I though was happening for IE promptly froze and eventually crashed.
Out with SyntaxHighlighter!
Haven’t looked back!