jquery跨js文件调用函数示例

 var common_func; (function() {
common_func = {
load_hot_data: function(AreaCode) {
var hot_html = "";
$.get("http://localhost:32684/Affairs/GetHotAffairsListKunMing?areaCode=" + AreaCode + "&pageSize=10",
function(data) {
if (data.Result) {
$.each(data.Data,
function(index, obj) {
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>'
})
} else {
hot_html = '<li>' + '<a href="javascript:;" title="">' + '<i class="_circle"></i>' + '<span>暂未找到热点事项信息</span>' + "</a>" + '</li>'
}
$("#hot_matter_more").prevAll().empty();
$("#hot_matter_more").before(hot_html); })
}, load_dept_data: function(AreaCode) {
var deptData = [];
$.get("http://localhost:32684/Dictionary/getAffairDeptTypeByArea?IS_LEGALPERSON=-1&AreaCode=" + AreaCode + "",
function(data) {
if (data.Result) {
$.each(data.Data,
function(index, obj) {
var item = {
link: "/Affairs/LegalPerson?groupNum=1&typeCode=" + obj.Code + "&typeName=" + obj.Name,
target: "_blank",
title: obj.Name,
id: obj.Code
}
deptData.push(item);
})
} else {
deptData.push({
link: "#",
target: "_blank",
title: "该区划下未找到部门信息"
});
}
$(".theme_dept_hot .theme_dept_info .box_dept_info ._dept_info").pageSilder("DeptPageSilder", {
pageSize: 30,
data: deptData
});
})
}
}
})()
上一篇:jQuery插件之验证控件jquery.validate.js


下一篇:2016 年 Java 工具和技术的调查:IDEA 已超过