meta info 
Simple Ajax Code-Kit (SACK) looks like a good project but it has a couple glitches when it comes to working with IE. The bulk of the issues are in the demo but there is also another area in the library that I have modified. Listed below is a quick and dirty fix of SACK with a download. The pieces are simply code fragments since there is a zip available at the end for download. A section of HTML before. (in demo.html)

  1. <select name="method" id="method">
  2. <option>GET</option>
  3. <option>POST</option>
  4. </select>

A section of HTML after. (in demo.html)

  1. <select name="method" id="method">
  2. <option value="GET">GET</option>
  3. <option value="POST">POST</option>
  4. </select>

Without the values, IE6 just gets back a blank which isn't terribly helpful as a request method. A piece of CSS before. (in style.css)

  1. #demo tr td {width: 250px; vertical-align: top; white-space: pre;}

A piece of CSS after. (in style.css)

  1. #demo tr td {width: 250px; vertical-align: top;}

IE6 seems to get confused by the white-space tag and ends up running the output together on one line and clipping. The output isn't as pretty in Firefox with white-space gone but at least it renders the same between browsers. A modified section of the javascript. (in tw-sack.js)

  1. this.createAJAX = function() {
  2. this.failed = true;
  3. try {
  4. this.xmlhttp = new XMLHttpRequest();
  5. this.failed = false;
  6. } catch (e) {
  7. var progIds = ['MSXML2.XMLHTTP', 'Microsoft.XMLHTTP', 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0'];
  8. for (var iterator = 0; (iterator < progIds.length) && ( ! this.success); iterator ++) {
  9. try {
  10. this.xmlhttp = new ActiveXObject(progIds[iterator]);
  11. this.failed = false;
  12. } catch (e) {}
  13. }
  14. }
  15. };

I tend to make this change because I feel that it is more flexible than other ways of getting the xmlhttp object. It works for me, but if you find an error please let me know.

Download


WinZip Click here to download the modified files.

Ajax * This was published to help people that have tried SACK and had problems. We at Fueled Software are doing this as a help but we don't support the library itself. You may want to direct any questions to the original author.
Related Posts
Yet Another Ajax Contact Page
What happened to...
Ajax Tabs Reloaded: based on the Havoc Studios article
Forms with moo.fx part 1
Forms with moo.fx part 2