jsnop
<script src="http://libs.baidu.com/jquery/1.6.1/jquery.min.js"></script>
<div id="showMsg"></div>
<script type="text/javascript">
$.getJSON("http://www.xxx.cc/xxxGateway/link/returnJsonp.shtml?from=100yue&locate=02&jsoncallback=?",function(data){
$("#showMsg").html(data[0].val);
});
</script>
@RequestMapping("/returnJsonp")
public void
returnJsonp(HttpServletRequest request, HttpServletResponse response) throws
IOException {
// 来源网站
String from
= request.getParameter("from");
// 来源位置
String
locate = request.getParameter("locate");
String jsoncallback =
request.getParameter("jsoncallback");
response.setContentType("text/html");
response.setCharacterEncoding("utf-8");
PrintWriter
out = response.getWriter();
//获取链接文字
String
returnval =
Constants.RB.getString("text_XXX");
out.print(jsoncallback+"([{val:‘"+returnval+"‘}])");
}
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。