var basic="" jQuery(document).ready(function($) { lfetmenus() }); //退出登录 function logout(){ $.ajax({ url: "/homepage/logout.htm", async: false, success:function(result){ location.href = "/login.jsf"; } }); } function lfetmenus(){ var path=window.document.location.pathname; jQuery.post(basic+'/admin/menucon/ftmenu.htm', {title:'lftmenus'}, function(data, textStatus, xhr) { if(data==null) return; var navlist=$('ul.nav-list'); navlist.empty(); var li_parent=null; var ul_child=null; var li_child=null; var li_parent_lft=0; var li_parent_rgt=0; jQuery.each(data, function(index, val) { var lft=val.lft; var rgt=val.rgt; if(lft '+val.title+' ').appendTo(ul_child); else li_child=jQuery('
  • '+val.title+'
  • ').appendTo(ul_child); }else{ li_parent=jQuery('
  • ').appendTo(navlist); ul_child=null; var a=jQuery('').appendTo(li_parent); var i=jQuery('').appendTo(a); var span=jQuery(''+val.title+'').appendTo(a); var b=jQuery('').appendTo(a); li_parent_lft=lft; li_parent_rgt=rgt; if(rgt-lft>1) { ul_child=jQuery('').appendTo(li_parent); }else{ a.removeClass('dropdown-toggle'); if(val.url!=null&&val.url!='') { a.attr('href',val.url); } } } if(val.url!=null&&val.url.indexOf(path)>=0) { li_parent.addClass('active'); li_parent.addClass('open'); if(li_child!=null) li_child.addClass('active'); } }); },'json'); } function isItems(items) { return ($.isArray(items) && items.length > 0) ? true : false; }