jquery ajax 跨域
$(document).ready(function() { var url = "http://220.176.196.172:8080/srsweb/AllSearch?searchType=ggqsyIndex&jsoncallback=?" $.getJSON(url,"", function(json) { alert(json); alert(json[0].a); alert(json[0].b); alert(json[0].c); //返回格式: ?(json_data) /*返回数据: ?([{"www_url":"www.aiisen.com","www_name":"www_name", "items":[{"p_name":"安徽省","p_index":340000},{"p_name":"北京市","p_index":110000}]}]) */ //调用实例:alert(json[0].www_url); }); });
response.setContentType("text/html;charset=utf-8"); PrintWriter out = response.getWriter(); EcmsContentTablesDao ecmsContentTablesDao = new EcmsContentTablesDao(); String type = request.getParameter("type"); String nodeParentDept = "_647"; String nodeParentDept1 = "_3"; int count = ecmsContentTablesDao.getMaxSearcheCount1Ggqsy(" select count(nodeid) as ct from ecms_nodes where parentdept = '"+nodeParentDept+"' or parentdept like '"+nodeParentDept+"!_%' escape '!' or parentdept = '"+nodeParentDept1+"' or parentdept like '"+nodeParentDept1+"!_%' escape '!' "); int count1= ecmsContentTablesDao.getMaxSearcheCount1Ggqsy("select count(*) as ct from ecms_content_info "); int count2= ecmsContentTablesDao.getMaxSearcheCount1Ggqsy("select count(*) as ct from ecms_content_info where Status='0'"); System.out.println("dddddddddddddd:"+"[{a:'"+count+"',b:'"+count1+"',c:'"+count2+"'}]"); String jsoncallback = request.getParameter("jsoncallback"); System.out.println("jsoncallback:"+jsoncallback); // out.write("[{a:'"+count+"',b:'"+count1+"',c:'"+count2+"'}]"); out.write(jsoncallback+"([{a:'"+count+"',b:'"+count1+"',c:'"+count2+"'}])"); out.flush(); out.close();
相关推荐
TONIYH 2020-07-22
83510998 2020-07-18
wcqwcq 2020-06-26
delmarks 2020-06-14
ppsurcao 2020-06-14
tthappyer 2020-06-07
kentrl 2020-11-10
结束数据方法的参数,该如何定义?-- 集合为自定义实体类中的结合属性,有几个实体类,改变下标就行了。<input id="add" type="button" value="新增visitor&quo
ajaxyan 2020-11-09
zndy0 2020-11-03
学留痕 2020-09-20
Richardxx 2020-11-09
learningever 2020-09-19
chongxiaocheng 2020-08-16
ajaxhe 2020-08-16
lyqdanang 2020-08-16
curiousL 2020-08-03