Download a file by jQuery.Ajax

2019 modern browsers update This is the approach I’d now recommend with a few caveats: A relatively modern browser is required If the file is expected to be very large you should likely do something similar to the original approach (iframe and cookie) because some of the below operations could likely consume system memory at least as … Read more

How to allow CORS in react.js?

Possible repeated question from How to overcome the CORS issue in ReactJS CORS works by adding new HTTP headers that allow servers to describe the set of origins that are permitted to read that information using a web browser. This must be configured in the server to allow cross domain. You can temporary solve this … Read more

jQuery: Performing synchronous AJAX requests

As you’re making a synchronous request, that should be Example – http://api.jquery.com/jQuery.ajax/#example-3 PLEASE NOTE: Setting async property to false is deprecated and in the process of being removed (link). Many browsers including Firefox and Chrome have already started to print a warning in the console if you use this: Chrome: Synchronous XMLHttpRequest on the main … Read more

jQuery – Illegal invocation

I think you need to have strings as the data values. It’s likely something internally within jQuery that isn’t encoding/serializing correctly the To & From Objects. Try: Notice also on the lines: You don’t need the jQuery wrapper as To & From are already jQuery objects.

JavaScript implementation of Gzip

Edit There appears to be a better LZW solution that handles Unicode strings correctly at http://pieroxy.net/blog/pages/lz-string/index.html (Thanks to pieroxy in the comments). I don’t know of any gzip implementations, but the jsolait library (the site seems to have gone away) has functions for LZW compression/decompression. The code is covered under the LGPL.