arabic text doesn't work with IE … jquery ajax

2019-08-28 14:29发布

问题:

$('#search_text').keyup(function() {

var search_text =  document.getElementById('search_text').value;

$.ajax({    
    url:"jx_displayautocompletelist.php",
    data: 'text='+search_text,
    success:function(result){

    $("#autocompleteresult").html(result);


        } 

    }); 
});

what i want to print text which written in "search_text" in ajax file its working with english but doesn't work with arabic

for example :

english :  football
arabic: كرة 

its working fine with firefox but doesn't work with arabic with IE

回答1:

Sory if this sounds stupid but have you changed your charset to accept arabic, if not try folowing code in head of HTML:

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1256"> or
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-6">