jquery js files across a function call example

 1 var common_func; (function() {
 2     common_func = {
 3         load_hot_data: function(AreaCode) {
 4             var hot_html = "";
 5             $.get("http://localhost:32684/Affairs/GetHotAffairsListKunMing?areaCode=" + AreaCode + "&pageSize=10",
 6             function(data) {
 7                 if (data.Result) {
 8                     $.each(data.Data,
 9                     function(index, obj) {
10                         hot_html += '<li>' + '<a href="javascript:;" title="' + obj.AffairName + '">' + '<i class="_circle"  style="transform: scale(1); background: rgb(153, 153, 153);" >' + '</i>' + '<span>' + obj.AffairName + '</span>' + '</a>' + '</li>'
11                     })
12                 } else {
13                     hot_html = '<li>' + '<a href="javascript:;" title="">' + '<i class="_circle"></i>' + '<span>暂未找到热点事项信息</span>' + "</a>" + '</li>'
14                 }
15                 $("#hot_matter_more").prevAll().empty();
16                 $("#hot_matter_more").before(hot_html);
17 
18             })
19         },
20 
21         load_dept_data: function(AreaCode) {
22             var deptData = [];
23             $.get("http://localhost:32684/Dictionary/getAffairDeptTypeByArea?IS_LEGALPERSON=-1&AreaCode=" + AreaCode + "",
24             function(data) {
25                 if (data.Result) {
26                     $.each(data.Data,
27                     function(index, obj) {
28                         var item = {
29                             link: "/Affairs/LegalPerson?groupNum=1&typeCode=" + obj.Code + "&typeName=" + obj.Name,
30                             target: "_blank",
31                             title: obj.Name,
32                             id: obj.Code
33                         }
34                         deptData.push(item);
35                     })
36                 } else {
37                     deptData.push({
38                         link: "#",
39                         target: "_blank",
40                          title: "sector not found at the division information"
 41 is                      });
 42 is                  }
 43 is                  $ () pageSilder ( "DeptPageSilder" "theme_dept_hot .theme_dept_info .box_dept_info ._dept_info.." , {
 44 is                      the pageSize: 30 ,
 45                      Data: deptData
 46 is                  });
 47              })
 48          }
 49      }
 50 }) ()

 

Guess you like

Origin www.cnblogs.com/netlws/p/11708963.html