Jump to content

SOLVED :: JQuery Ajax Encoding Problem


samerhannoun
 Share

Recommended Posts

Hi Guys,, I face a problem with IE7 and higher with AJAX request encoding, in brief, I have drop down menu contains folders names in Swedish language, and its contains some special characters, when the user change the select (dropdown) form element, there something should be done. everything is ok whith folders names thats not contain Swedish characters, the other folder(contain Swedish letters) when the user choose it nothing happen. So I think its encoding problem, what can I do to solve that?this is my function $("#edit-display-section").change(function(){ var txt= $("#edit-display-section option:selected").text();var fire = function(data) { document.getElementById('samer').innerHTML=(data); } $.ajax({ url: "calc/ajax/"+txt, type: 'POST', success:fire, contentType: "application/x-www-form-urlencoded;charset=utf-8", beforeSend: function(xhr) { xhr.setRequestHeader("Accept-Charset","utf-8"); xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8"); }, });the php file also UTF encode.thanks in advance for any help

Edited by Rainjo
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...