首页 新闻 搜索 专区 学院

为什么我的if语句是错的

0
悬赏园豆:20 [已关闭问题] 关闭于 2016-07-15 14:50

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Basic CRUD Application - jQuery EasyUI CRUD Demo</title>
<link rel="stylesheet" type="text/css"
href="script/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="script/themes/icon.css">
<link rel="stylesheet" type="text/css" href="script/themes/color.css">
<link rel="stylesheet" type="text/css" href="script/demo/demo.css">
<script type="text/javascript" src="script/jquery.min.js"></script>
<script type="text/javascript" src="script/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="script/jquery.easyui.min.js"></script>
<script type="text/javascript">
function openTab(tab) {
$tab = $(tab);
alert($tab.text());
if ($('#content').tabs('exists', $tab.text())) {
alert("1");
$('#content').tabs('select', $tab.text());
} else {
alert("2");
$('#content').tabs('add', {
title : $tab.text(),
selected : true,
colsable : true,
herf : $tab.attr('data-href')

});
}
}
</script>
</head>
<body class="easyui-layout">
<div region="north" split="true" style="width: 150px; height: 70px;">标题</div>
<div id="content" region="center" class="easyui-layout">
<div region="west" split="true" title="导航" style="width: 300px;"
class="easyui-accordion">

<div title="标题1">
<ul id="tt1" class="easyui-tree">
<li><span>Folder1</span>
<ul>
<li><span>Sub Folder 1</span>
<ul>
<li><a href="javascript:void(0)" data-href="view.jsp"
onclick="openTab(this)">File11</a></li>
<li><a href="javascript:void(0)" data-href="view.jsp"
onclick="openTab(this)">File12</a></li>
<li><span>File13</span></li>
</ul></li>
<li><a href="javascript:void(0)" data-href="view.jsp"
onclick="openTab(this)">File2</a></li>
<li><span>File3</span></li>
</ul></li>
</ul>
</div>
<div title="标题2">
<ul id="tt2" class="easyui-tree">
<li><span>Folder2</span>
<ul>
<li><span>Sub Folder 2</span>
<ul>
<li><span>File 21</span></li>
<li><span>File 22</span></li>
<li><span>File 23</span></li>
</ul></li>
</ul></li>
</ul>
</div>
<div title="标题3"></div>

 

</div>
<div id="content" region="center" class="easyui-tabs">
<div title="aaa" data-options="closable:true" style="padding: 10px">aaa</div>
<div title="File11" data-options="iconCls:'icon-help',closable:true"
style="padding: 10px">2</div>
</div>

</div>

</body>
</html>

木哆哆哆的主页 木哆哆哆 | 菜鸟二级 | 园豆:204
提问于:2016-07-15 14:33
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册