JavaScript errors fixed

By Richard X. Thripp at 2008-11-23T04:21:16Z in News, with these tags: blogs, bugs, internet explorer, javascript, problems, jump to comment form. 221 words.

For a long time, Thripp.com has had an error in its JavaScript file. This goes back to when I condensed all the JavaScript used on the site to one compressed file four months ago, which was tough to do because the JavaScript was from separate plugins.

Everything worked fine, but you’d get a yellow triangle in the status bar in Internet Explorer only, with a cryptic error message. I could never get it to go away because there were actually two problems at work:

1. Prototype.js has to go at the end of the conglomerated JavaScript file because it ends with the document.write function which always has to be at the end of a JavaScript file because it inserts HTML or other code into the HTML (or something like that).
2. The code for WP Grins, the plugin I use for clickable smilies on the comment forms, must go AFTER Prototype, because it requires functions from the Prototype library.

Sounds impossible, right? The solution is to split them into two JavaScript files. I’d become so driven in optimizing the site for the fewest HTTP requests that I didn’t even think of that. I took WP Grins out of the merged thripp.js file and installed the unmodified plugin. I’m letting it do its own thing.

No more yellow triangles in Internet Explorer. The JavaScript errors are fixed.

Post to Twitter Post to Plurk Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to StumbleUpon



2 Comments, newest threads first. Join the discussion. RSS feed for this entry.


Have no fear — commenting is here. Comments RSS feed.

These HTML tags work: a href, abbr, acronym, b, blockquote, code, em, i, strike, strong, u. You will be emailed if anyone replies to your comment. Gravatars work here. Thanks for commenting!