I’m using the .load() method in jQuery but I’ve realized that the request to my server should use ISO-8859-1 charset and not UTF-8. The problem is that I can’t find how to set load method to use a different encoding. I read that .ajax method has ‘content-type’ setting to do this, but what about load method? I find load very useful when I need to update data from some divs without refreshing the page.
Any help would be appreciated, thanks.
Using
ajaxSetupallows you to specify the settings for new ajax calls.with
beforeSendyou can provide a callback function to modify the XMLHttpRequest object before it’s going to be send. jQuery ReferenceMozilla provides documentation about
overrideMimeType():Borrowing code from this answer you could do: