Skip to content

Releases: canjs/can-ajax

Should not error when loading if globals.location is undefined

12 Oct 21:52
Compare
Choose a tag to compare

Fixing package/main to work better with webpack/babel

07 May 19:22
Compare
Choose a tag to compare

2.4.5

01 Oct 17:56
Compare
Choose a tag to compare

Fix issue with multipart/form-data uploads

This patch release fixes an issue where can-ajax sets the incorrect Content-Type header when the request payload is a FormData instance.

For file uploads or where manually using FormData in the can-ajax request payload, DO NOT SET the Content-Type header to multipart/form-data. The browser will set the correct header and boundary.

Do this:

ajax({
  url: "....",
  type: "POST",
  data: formData
});

Instead of this:

ajax({
  url: "...",
  type: "POST",
  data: formData,
  beforeSend(xhr) {
    xhr.setRequestHeader("Content-Type", "multipart/form-data");
  }
});

Replace `const` with `var`

25 Jun 14:48
Compare
Choose a tag to compare

Replaced single const declaration with var to match the rest of the code and fix a stealjs strict error in iOS

QUNIT2 upgrade

28 May 17:53
Compare
Choose a tag to compare

This updates the tests to use QUnit@2.x.x.

#62

Downgrade tests to ES5 syntax

24 May 04:42
Compare
Choose a tag to compare

The test suite for can-ajax threw syntax errors on IE11 due to the presence of ES6 arrow functions. StealJS does not automatically transpile to ES5 when using the CommonJS format as all CanJS sources do, so these function were being passed to the script engine unmodified.

This patch release does not involve changes to the can-ajax production code, and is primarily to ensure that the CanJS test suite runs smoothly on IE11.

Documentation cleanup

16 Apr 19:55
Compare
Choose a tag to compare
  • Fix a link to jQuery’s docs
  • Show importing from can

#60

Support async: false

10 Apr 20:08
Compare
Choose a tag to compare

Some very old legacy code may be dependent on having synchronous AJAX. While we don't recommend using it for any current for future development, it is now supported in can-ajax. To use synchronous AJAX, the async property must be explicitly set to false.

For synchronous calls, Promises still resolve in microtasks as with asynchronous AJAX, but success and error callbacks passed as properties to ajax() are resolved in thread. This means that success and error callback properties are now officially part of the public API as well. They were previously supported but undocumented.

Note: due to an error in versioning, 2.4.0 is the next revision published after 2.2.2, and there is no version 2.3.0.

Support async: false

10 Apr 20:09
Compare
Choose a tag to compare

Some very old legacy code may be dependent on having synchronous AJAX. While we don't recommend using it for any current for future development, it is now supported in can-ajax. To use synchronous AJAX, the async property must be explicitly set to false.

For synchronous calls, Promises still resolve in microtasks as with asynchronous AJAX, but success and error callbacks passed as properties to ajax() are resolved in thread. This means that success and error callback properties are now officially part of the public API as well. They were previously supported but undocumented.

Fix tests

26 Mar 17:17
Compare
Choose a tag to compare
  • Add missing restore() calls to tests #58
  • Add @Package so the GitHub & npm badges show up in the docs #56