为什么IE只在使用阿拉伯语或波斯语等其他语言发送ajax请求时才识别字符

时间:2022-11-11 01:42:09

I send a string for search with jquery ajax, it is working true in en lang alphanumeric characters, but dont work in cases that typing arabic or farsi lang.

我使用jquery ajax发送一个字符串进行搜索,它在en lang字母数字字符中工作正常,但在输入arabic或farsi lang的情况下不起作用。

this occur just in IE , this script working in chrome and firefox perfectly! you can see in here: http://webzzz.com

这只发生在IE中,这个脚本完美地在chrome和firefox中工作!你可以在这里看到:http://webzzz.com

3 个解决方案

#1


0  

this is what i get after entering a text in the search box:

这是我在搜索框中输入文字后得到的结果:

为什么IE只在使用阿拉伯语或波斯语等其他语言发送ajax请求时才识别字符

not sure what to expect as it is in arabic.

不知道在阿拉伯语中会发生什么。

#2


0  

You need to check that what is received by the server is correctly encoded. It seems IE7,8,9 has problem with that.

您需要检查服务器收到的内容是否已正确编码。似乎IE7,8,9有问题。

I got a similar problem with AJAX request send with 'GET' method. I solved it by encoding the non-ASCII argument of my request using encodeURI(URI) function.

使用'GET'方法发送AJAX请求时出现了类似的问题。我通过使用encodeURI(URI)函数编码我的请求的非ASCII参数来解决它。

#3


0  

I solved it: the problem was in the ajax script

我解决了它:问题出在ajax脚本中

**// this not working with ie browser when using arabic letters** 
xmlhttp.open("GET","livesearch.php?q="+str,true);
xmlhttp.send();

***// this will work in ie browser even with arabic letter after insert uncode(url)***
var uri = "livesearch.php?q="+str ;
var res = encodeURI(uri);
xmlhttp.open("GET",res,true);
xmlhttp.send();

#1


0  

this is what i get after entering a text in the search box:

这是我在搜索框中输入文字后得到的结果:

为什么IE只在使用阿拉伯语或波斯语等其他语言发送ajax请求时才识别字符

not sure what to expect as it is in arabic.

不知道在阿拉伯语中会发生什么。

#2


0  

You need to check that what is received by the server is correctly encoded. It seems IE7,8,9 has problem with that.

您需要检查服务器收到的内容是否已正确编码。似乎IE7,8,9有问题。

I got a similar problem with AJAX request send with 'GET' method. I solved it by encoding the non-ASCII argument of my request using encodeURI(URI) function.

使用'GET'方法发送AJAX请求时出现了类似的问题。我通过使用encodeURI(URI)函数编码我的请求的非ASCII参数来解决它。

#3


0  

I solved it: the problem was in the ajax script

我解决了它:问题出在ajax脚本中

**// this not working with ie browser when using arabic letters** 
xmlhttp.open("GET","livesearch.php?q="+str,true);
xmlhttp.send();

***// this will work in ie browser even with arabic letter after insert uncode(url)***
var uri = "livesearch.php?q="+str ;
var res = encodeURI(uri);
xmlhttp.open("GET",res,true);
xmlhttp.send();