FUSHIONCHART link js 乱码

 

 在节点<chart>中添加属性“unescapeLinks='0'”即可解决Link中JS参数中文乱码问题,但搞半天,解决不了,原来是swf文件版本低啦。更新版本,OK解决啦。

 

 

 

  

<div id="fusionChartDiv" align="center" valign="center">图表加载中,请稍候... </div>
       <script type="text/javascript">
          var width = "<c:out value="${param.width}" default="800"/>";
           var heigth ="<c:out value="${param.heigth}" default="400"/>"; 
     var chart = new FusionCharts("${ctx}/js/fusioncharts/${param.swf}?ChartNoDataText=无数据", "ChartId", width, heigth, "0", "0");
     <c:choose>
      <c:when test="${param.series=='2'}">
     var  url   = '${ctx}/report/getMSDataXML.mvc';
      </c:when>
      <c:otherwise>
   var url = '${ctx}/report/getSSDataXML.mvc';
      </c:otherwise>
   </c:choose>
     url = url +"?1=1<%=ParamUtil.getUrlParam(request)%>";
     $j.ajax({
    type: "POST",
    url: url,
    success: function(data){
     chart.setDataXML(data);  
     chart.render("fusionChartDiv");
    }
   });
  </script> 

 

 

关于AJAX请求过滤的问题

 /**
  * JQUERY 的AJAX POST请求,使用UTF-8编码 ,其他情况使用默认编码
  * @param request
  * @param defaultEncoding
  * @return
  */
 private String getRequestEncoding(HttpServletRequest request,
   String defaultEncoding) {
  String encoding = "";
  String requestedWith = request.getHeader("X-Requested-With");
  String contentType = request.getContentType();
  if ("XMLHttpRequest".equalsIgnoreCase(requestedWith)
    && contentType != null
    && contentType.startsWith("application/x-www-form-urlencoded")) {
   encoding = AJAX_POST_ENCODING;
  } else {
   encoding = defaultEncoding;
  }
  return encoding;
 }

 

你可能感兴趣的:(C++,c,Ajax,mvc,C#)