jquery $.getJSON 乱码

 

 

页面处理

var hotelCode =encodeURI($("#hotelCode").val(),"utf-8");

var hotelName = encodeURI($("#hotelName").val(),"utf-8");

后台处理

 

Hotel hotel = new Hotel();

hotel.setHotelName(URLDecoder.decode(hotelName,"utf-8"));

hotel.setHotelCode(URLDecoder.decode(hotelCode,"utf-8"));

   

 

你可能感兴趣的:(jquery)