日期:2014-05-16 浏览次数:20630 次
$(document).ready(function() {
var html = "<div class='tabbable tabs-left'><ul class='nav nav-tabs'>";
var html_institute = '';
var html_subject = '';
$.get("@{ViewResource.viewInstitute}",function(institute_data){
$.each(institute_data,function(commentIndex, comment){
html_institute += "<li><a href='#tab"+commentIndex+ "'data-toggle='tab'>"+institute_data[commentIndex]+"</a></li>";
var value = institute_data[commentIndex];
//alert(institute_data[commentIndex]);
//alert(html_institute);
//alert(1);---------------------------------1
$.get("@{ViewResource.viewSubject}",{
institute : value
},function(subject_data){
// alert(commentIndex);
// alert(value);
alert(html_subject);
html_subject += "<div class='tab-pane' id='tab"+commentIndex+"'>";
$.each(subject_data,function(subject_commentIndex, subject_comment){
//alert(subject_data[subject_commentIndex].subject);
html_subject += "<p>"+subject_data[subject_commentIndex].subject+"</p>";
});
html_subject += "</div>"
//alert(html_subject);
});
});
//html += html_institute + "</ul>" + "<div class='tab-content'>" + html_subject +"</div></div>";
//alert(html)
},"json");
});
//生成分类列表
var s=getSubid(0,data_categroy,0);
$('#form_publish .categroy').append(s);
function getSubid(cid,data,nbsp){
var rs,s='';