首页 > 代码库 > HTML传值乱码

HTML传值乱码

              myChart.on(‘click‘, function (param) {
                    $(‘#dlg_select‘).window({href:‘<%=request.getContextPath()%>/jsp/bgData/vehicleDataView.jsp?vehModelName=‘+encodeURI(param.name)+‘&flag=‘+param.seriesIndex})
                    .window(‘setTitle‘,‘车辆列表‘)
                    .window(‘open‘);
                   });

如果传到后台乱码的话 往后台传还需要用encodeURI转一遍
 $(‘#tg‘).datagrid({  //往后台传 
      url:"<%=request.getContextPath()%>/vehicleDataController/vehicleList?vehModelName="+encodeURI(vehModelName)+"&flag="+flag,   

 

HTML传值乱码