Linked Questions

Popular Questions

Problem with sending Arabic language using ajax

Asked by At

I'm using this example to get the suggested words, it works fine with english words, but when i type in Arabic language i note that the $q = $_REQUEST["q"] is giving unknown characters when i var_dump($q), this problem is happening when i use Internet Explorer on windows 10 but with Google Chrome, everything is good.

I guess the problem is related to utf8 in Ajax code that internet explorer couldn't recognize Arabic characters, but i don't know how to modify it.

function showHint(str) {
if (str.length == 0) { 
    document.getElementById("txtHint").innerHTML = "";
} else {
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {

        if (this.readyState == 4 && this.status == 200) {
            document.getElementById("txtHint").innerHTML = 
    };"GET", "gethint.php?q=" + str, true);

Any help please!

Related Questions