http://thripp.com

JavaScript errors fixed

By Richard X. Thripp at 2008-11-23T04:21:16Z in News. 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 [1], 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.




Printed from: http://thripp.com/blog/javascript-errors-fixed-155
Short URL: hoqow.th8.us

URLs in this entry:
[1] WP Grins: http://wordpress.org/extend/plugins/wp-grins/

Copyright © 2008 Richard X. Thripp.