7
回答
jquery动态的调取菜单
【腾讯云】学生服务器套餐10元/月 >>>   
var _menus = {"menus":[
{"menuid":"1","icon":"icon-sys","menuname":"控件使用",
"menus":[
{"menuname":"菜单管理","icon":"icon-nav","url":"demo.html"},
{"menuname":"添加用户","icon":"icon-add","url":"demo.html"},
{"menuname":"用户管理","icon":"icon-users","url":"demo.html"},
{"menuname":"角色管理","icon":"icon-role","url":"demo.html"},
{"menuname":"权限设置","icon":"icon-set","url":"demo.html"},
{"menuname":"系统日志","icon":"icon-log","url":"demo.html"}
]},
{"menuid":"8","icon":"icon-sys","menuname":"项目管理",
"menus":[
{"menuname":"项目","icon":"icon-nav","url":"demo.html"}
]}]};

上面是静太调用js

要换成下面的

 var _menus = getMenus();
        function getMenus(){
         var menu="";
         $.ajax({
          type:'post',
          url:'/xxx/menus/getMenus',
          error:function(){$.messager.alert('基本权限管理系统','目前网络繁忙,请稍候在试!','error');},
         });
         return menu;
        }

就出问题了,该如何来搞?

举报
小米粥
发帖于7年前 7回/2K+阅
顶部