|
-
- window.master = {
- loadcss:function(src){
- var head=document.getElementsByTagName("head")[0];
- var link = document.createElement('link');
- link.href = src;
- link.rel = "stylesheet";
- link.type = "text/css";
- head.appendChild(link);
- },
-
- loadModul:function(ev){
- var src = $(this).attr("load-href");
- if($(".control-show").find('.'+src).length===0){
- master.loadcss("css/"+src+".css")
- $.ajax({
- url:src+".html",
- success:function(text){
- $(".control-show").append(text);
- console.log(text);
- },
- dataType:"html",
- });
- $.getScript("js/"+src+".js");
-
- }else{
- console.log(1)
-
- }
- },
- dropDown:function(){
- $('.dropdown-toggle').on("click",function(){
- $(this).next().slideToggle(200).parent().toggleClass("open");
- })
- }
- //filterData:function(dom,){}
-
- };
-
- $(document).ready(function(){
- //$('.loadModul').on('click',master.loadModul);\
- var ht_user_id=$.cookie('ht_user_role');
- var menu_file = "./leftmenu"+ht_user_id+".html";
-
-
- $.ajax({
- url:menu_file,
- success:function(data){
- $(".control-bar").html(data);
- // master.dropDown();
- master.dropDown();
- }$("#x_guanli0").css("color","#000");
- })
-
-
- });
-
-
|