Can't get bengali data from server using jQuery AJAX

I can't get bengali data from the server using ajax. The data from the server is replaced with something I don't know. But if I usually install non-ajax data tools, the data is displayed correctly. My code:

<meta content="html/text" charset="UTF-8"> in .jsp file

$.ajax({
   url: "",
   data: "a=a",
   contentType: "charset=utf-8",
   method: "get",
   success:function(){
   },
   failure:function(){
   }
});

      

I used a link from UTF8 encoding not working when using ajax , but even that didn't work.

+3


source to share


1 answer


The error is specified in the ajax

configuration.

contentType="charset=utf-8",

Here you should use :

instead =

.



See the error highlighted in the code below.

$.ajax({
    url: "YOUR URL HERE?myparam1=value1&param2=value2",
    data: "a=a",
    contentType: "charset=utf-8",
    //         ^
    method: "GET",
    success: function(resp) {},
    failure: function(err) {}
});

      

+2


source







All Articles