王小白how 2019-05-06 15:33
浏览 550

使用easyui布局的 怎么可以点击按钮 在center打开界面 不发生跳转

使用easyui布局的 怎么可以点击按钮 在center打开界面 不发生跳转

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
    <title>老师信息管理中心</title>
    <%
            //权限验证
            if(session.getAttribute("currentUser")==null){
                System.out.println("滚");
                response.sendRedirect("index.jsp");
                return;
            }
    %>
        <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href=".easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
    $(function(){
        // 数据
        var treeData=[{
            text:"信息管理",
            children:[{
                text:"学生发布广场",
                attributes:{
                    url:"studentPlace.jsp"
                }
            },{
                text:"老师发布广场",
                attributes:{
                    url:"teacherPlace.jsp"
                }
            },{
                text:"个人信息",
                attributes:{
                    url:"mysession.jsp"
                }
            },{
                text:"我发布的信息",
                attributes:{
                    url:"Myself.jsp"
                }
            },{
                text:"网站信息",
                attributes:{
                    url:"webInstruction.jsp"
                }
            },{
                text:"违规用户信息",
                attributes:{
                    url:"manInfoManager2.jsp"
                }
            },{
                text:"我的沟通",
                attributes:{
                    url:"say.jsp"
                }
            },{
                text:"我的订单",
                attributes:{
                    url:""
                }
            }]
        }];

        // 实例化树菜单
        $("#tree").tree({
            data:treeData,
            lines:true,
            onClick:function(node){
                if(node.attributes){
                    openTab(node.text,node.attributes.url);
                }
            }
        });

        // 新增Tab
        function openTab(text,url){
            if($("#tabs").tabs('exists',text)){
                $("#tabs").tabs('select',text);
            }else{
                var content="<iframe frameborder='0' scrolling='auto' style='width:100%;height:100%' src="+url+"></iframe>";
                $("#tabs").tabs('add',{
                    title:text,
                    closable:true,
                    content:content
                });
            }
        }
    });
    </script>
  </head>
  <body class="easyui-layout">
  <div region="north" style="height:120px; background-color:#E0EDEF">
        <img  src="image/3.jpg">
        <input type="button" value="学生发布广场" onclick="javascrtpt:window.location.href='studentPlace.jsp'" target="main">
        当前用户:&nbsp;<font color="red" >${currentUser.userName }</font>
        <a href="studentPlace.jsp" target="center"> 学生发布广场</a>
  </div>
    <div region="center" style="height:1000px;" name="main" title="欢迎使用">
            <div class="easyui-tabs"  border="false"  id="tabs">
            <div title="首页">
            <div align="center" style="padding-top: 100px;"name="main"><font color="red" size="10">欢迎使用</font></div>
            </div>
            </div>
    </div>
    <div region="west" style="width:150px;" title="导航菜单"  split="true">
    <ul id="tree"></ul>
    </div>
        <div region="south" style="height:25px;" align="center">版权所有<a href="http://www.baidu.com">www.baidu.com</a></div>
  </body>
</html>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 krpano-场景分组和自定义地图分组
    • ¥15 lammps Gpu加速出错
    • ¥15 关于PLUS模型中kapaa值的问题
    • ¥15 关于博途V17进行仿真时无法建立连接问题
    • ¥15 机器学习教材中的例题询问
    • ¥15 求.net core 几款免费的pdf编辑器
    • ¥15 为什么安装HCL 和virtualbox之后没有找到VirtualBoxHost-OnlyNetWork?
    • ¥15 C# P/Invoke的效率问题
    • ¥20 thinkphp适配人大金仓问题
    • ¥20 Oracle替换.dbf文件后无法连接,如何解决?(相关搜索:数据库|死循环)