How silly of me

Monday, December 17, 2007

I used to get a lot of comment spam on this weblog. 99.9% of them were caught and so they never showed up in the comments, but I still had to delete the comments in the control panel. In the last couple of months the comment spam has died down to nothing. I was congratulating myself for solving this comment spam problem (although it’s really EE’s security features and Loweblog’s Akismet module that should get all the credit) when I realized that in the last couple of months I had turned on the option to close comments after 30 days. ouch So obviously I wouldn’t get any comment spam if no one can post comments! And I rarely make public posts these days.

Replacing 8kb of javascript for 36kb

Monday, December 17, 2007

A long time ago I came up with a solution to use inline editing with EE using some ajax magic. The problem with that solution though was that the page would refresh once you submit something to edit. I figured that there must be a more elegant solution, one that updated the edited information without a page refresh.

I decided to revisit this problem and rewrite the code using the jQuery javascript library and the jQuery form plugin. However, there is a lot more javascript involved. The jQuery file itself is 26kb (the packed version), the jQuery form plugin file is 6kb, and the custom code is 4kb, so the total amount of javascript I have to include on every page is 36kb. The original solution used only 8kb of javascript (although it did require me to edit the HTML to add the javascript call, whereas with jQuery I don’t have to).

Oh well. At least I got to learn how to use the jQuery library. And, since I am the only person who’s authorized to do any editing, I made it so the javascript files are only loaded when I’m logged in, so it doesn’t make any difference whatsoever to you the reader.

Page 1 of 1 pages