The Simple Ajax Code Kit (SACK) is a javascript library that takes the hassle out of AJAX programming.
This could be especially useful to any WordPress Plugin authors out there that don’t want to spend time messing around with code that isn’t directly to do with their plugin. Implementation is as simple as three lines of code so it makes your code look a lot neater as well.
Key features are:
- Simple and light to implement.
- Addresses security issues that toolkits such as SAJAX have.
- Handles international strings (UTF-8).
Full documentation is available at the link above, and it will soon be part of other plugins such as WordPress: Touched. Enjoy, I hope you find it very useful.
Nice, Thanks!
I’ll be giving this a look for at least two projects.
I’ll be interested to see them 🙂
The only problem with SACK is, that it only supports UTF-8
I eat my last comment for breakfast. There is no problem with sack… The problem was with me using it. You have to set the right headers for script that loads in DIV and of course you have to convert passed variables from utf-8 to whatever encoding you want.
Example:
header(“Content-type: text/plain; charset=windows-1250”);
header(“Cache-Control: no-store, no-cache”);
$_POST[variable_name]=iconv(“utf-8”, “windows-1250”, $_POST[variable_name]);
That’s correct SACK only supports UTF-8 as JavaScript only encodes as latin-1 or UTF-8. Obviously to support anything other than english SACK had to use UTF-8.
Using iconv as Breci is doing is a perfect way to convert the UTF-8 data, if you need to, to another format (but unless you *need* to, try to use UTF).