…and I’m back.

After around 3 weeks of nothing, I can only apologise - as real life and work has been meaning the last thing I have been able to do is take care of this corner of the web. My poor delapidated website! I must look after you more (and finish the redesign).

It’s that time again, an updated version of the Simple AJAX Code Kit.

This time however you can thank Matthew Turland for generally being awesome and adding in the latest batch of changes. Matthew and I discussed some ideas for SACK over IM and we came up with some really neat additions. He was then cool enough to add them in himself and send them to me. I should have released this miles earlier, but aforesaid real life stuff got in the way.
Sorry about that.

After checking it over it’s now ready to release, so what’s new with SACK? Well…

  • New option: queryStringSeparator, which defaults to “?” - most of you won’t need to change this, but someone might, so may as well make it simple to do eh?
  • New option: argumentSeparator, which defaults to “&” - again, most of you won’t need or want to change this, but you might.
  • new method - onError, a function that is called when the status code of the response isn’t 200 - something has probably gone wrong with the request.
  • new method - onFail, the most significant change. Now, instead of the failedalert message (which most people seem to be turning off anyhow), the code will run this function if AJAX isn’t supported by the browser. This puts the reaction firmly in your control - you could use other methods, or maybe even just redirect to a version that supports older browsers. Anything really - it’s up to you.
  • Plus Matthew tweaked some of the string parsing I was doing to use regular expressions, which is great as I’d always wanted that but never really bothered with it (regular logic worked and was easier to test with when I wrote it). In theory this should make SACK slightly faster, though I’m not sure if it will be noticable.

Anyhow, please let me know what you think: is it good? How can it be better? Found a bug? Got a feature idea? All of the above can be sorted with a simple comment here on this post!

Go to the main SACK page and get the new version which is, as ever, completely compatible with the old one.

edit - a small bug in formatting the urlstring when one has already been passed to the library was pointed out to me, and I have updated the library to reflect that. This version is 1.6.1.