[jQuery] Bug? ajax request headers not being modified by beforeSend (jquery 1.3.1)
I need some help here guys.
I'm trying to modify the content-type and accept-charset request
headers of an ajax call and it seems that beforeSend does not really
change the XHR object.
My code is something like this:
beforeSend : function(xhr) {
xhr.setRequestHeader('Accept-Charset','windows-1253');
xhr.setRequestHeader('Content-type','application/x-www-form-
urlencoded;charset=windows-1253')
}
I need the charset to be windows-1253 and not UTF-8, as the database
and everything in between (server side scripts) are encoded with
windows-1253.
My html page has the correct charset specified:
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1253" />
<meta http-equiv="Content-Script-Type" content="text/javascript;
charset=windows-1253" />
If I submit the form without ajax, the charset is ok and my data is
saved correctly. Otherwise non-latin characters are replaced with
weird characters. From what I understand, changing the charset &
encoding to UTF-8 is currently not an option.
Any suggestions? Is this a jquery bug or I'm I doing something wrong?