把window.frames['myFrame'].frames['zhaiyao'].src在同一个js文件下面的两个方法中提取出来共用?
functiontree222(){//汉族document.getElementById("fenxi_icon").innerHTML="<lionclick='ch...
function tree222(){//汉族
document.getElementById("fenxi_icon").innerHTML = "<li onclick='chengeblockf(\"1\",\"1\")'>人口数量分析</li>" +
"<li onclick='chengeblockf(\"1\",\"2\")'>人口职称分布</li><li onclick='chengeblockf(\"1\",\"3\")'>流动情况</li>";
window.frames["myFrame"].map.showTablePoints({tableName:"VIEW_GISTHEME_GCSJ_MZ",whereClip:"nationid='01'",fileds:"id,name,sicon",open:true,clickEvent:tree422FN,mouseoverEvent:function(obj,opt){
obj.srcElement.title=obj.data.name;
}});
window.frames['myFrame'].frames['zhaiyao'].src = "./zhaiyao/mz_h.html";
}
function tree233(){//少数民族
document.getElementById("fenxi_icon").innerHTML = "<li onclick='chengeblockf(\"1\",\"1\")'>人口数量分析</li>" +
"<li onclick='chengeblockf(\"1\",\"2\")'>人口职称分布</li><li onclick='chengeblockf(\"1\",\"3\")'>流动情况</li>";
window.frames["myFrame"].map.showTablePoints({tableName:"VIEW_GISTHEME_GCSJ_MZ",whereClip:"nationid != '01'",fileds:"id,name,sicon",open:true,clickEvent:tree422FN,mouseoverEvent:function(obj,opt){
obj.srcElement.title=obj.data.name;
}});
window.frames['myFrame'].frames['zhaiyao'].src = "./zhaiyao/mz_s.html";
} 展开
document.getElementById("fenxi_icon").innerHTML = "<li onclick='chengeblockf(\"1\",\"1\")'>人口数量分析</li>" +
"<li onclick='chengeblockf(\"1\",\"2\")'>人口职称分布</li><li onclick='chengeblockf(\"1\",\"3\")'>流动情况</li>";
window.frames["myFrame"].map.showTablePoints({tableName:"VIEW_GISTHEME_GCSJ_MZ",whereClip:"nationid='01'",fileds:"id,name,sicon",open:true,clickEvent:tree422FN,mouseoverEvent:function(obj,opt){
obj.srcElement.title=obj.data.name;
}});
window.frames['myFrame'].frames['zhaiyao'].src = "./zhaiyao/mz_h.html";
}
function tree233(){//少数民族
document.getElementById("fenxi_icon").innerHTML = "<li onclick='chengeblockf(\"1\",\"1\")'>人口数量分析</li>" +
"<li onclick='chengeblockf(\"1\",\"2\")'>人口职称分布</li><li onclick='chengeblockf(\"1\",\"3\")'>流动情况</li>";
window.frames["myFrame"].map.showTablePoints({tableName:"VIEW_GISTHEME_GCSJ_MZ",whereClip:"nationid != '01'",fileds:"id,name,sicon",open:true,clickEvent:tree422FN,mouseoverEvent:function(obj,opt){
obj.srcElement.title=obj.data.name;
}});
window.frames['myFrame'].frames['zhaiyao'].src = "./zhaiyao/mz_s.html";
} 展开
2个回答
2012-08-03
展开全部
看完你的代码。。我震惊了。。你知道有种叫委托的东西。。你知道有种叫封装的概念么。。hoho~
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询