在网上看视频下载的源码,放在自己机上运行遇到的问题。如题
下面上图
部署在weblogic中 打开浏览器 单击“用户管理” 不能展开如下图
并且提示AdminTree.js脚本文件中parentDiv.children is not a function
AdminTree.js代码如下
var isIE = true;
var imgUp = "images/arrowUp.gif" ;
var imgDn = "images/arrowDn.gif" ;
function expandIt( head, fExpandOnly )
{
//alert(!fExpandOnly);
var bulletImg ;
var allCol = "document." + ( isIE ? "all." : "" ) + head ;
//var allCol = document.head;
var parentDiv = eval( allCol + "Parent" );
var childDiv = eval( allCol + "Child" );
if ( isIE )
{
if ( parentDiv )
bulletImg = parentDiv.children( 0 ).children( 'imEx' );
if ( childDiv )
{
if ( childDiv.style.display == "block" && (!fExpandOnly) )
{
childDiv.style.display = "none" ;
if ( bulletImg )
bulletImg.src = imgUp ;
}
else
{
childDiv.style.display = "block" ;
if ( bulletImg )
bulletImg.src = imgDn ;
}
}
}
else
{
if ( parentDiv )
bulletImg = parentDiv.document.images[ 'imEx' ];
if ( childDiv )
{
if ( childDiv.visibility == "hide" )
{
childDiv.visibility = "show" ;
if ( bulletImg )
bulletImg.src = imgDn ;
}
else if ( ! fExpandOnly )
{
childDiv.visibility = "hide";
if ( bulletImg )
bulletImg.src = imgUp ;
}
}
}
return false ; // cancels event
}
function doClick ( )
{
el = event.srcElement;
while ( el && el.tagName != "A" )
{
el = el.parentElement ;
}
if ( ! el ) return ;
if ( el.target != "main" ) return ;
hiliteSel( el );
}
var prevSel = null ;
function hiliteSel ( selLink )
{
var selColor = "red" ;
if ( prevSel )
{
prevSel.style.color = prevSel.prevColor ;
}
prevSel = selLink ;
prevSel.prevColor = selLink.style.color ;
selLink.style.color = selColor ;
}
function init() {
document.onclick = doClick ;
expandIt("head2");
//hiliteSel(ttt);
// parent.frames("Main").location.href = "/gtc/programMgr.html";
}
if ( screen.colorDepth > 8 )
{
// document.write( "<STYLE>BODY{background-image:url(/images/ai/tile_nav.jpg);}</STYLE>" );
}
var licenseID ='01-0006-0038-69648' ;
var pendingChanges =false ;
这个问题困扰了我好几天,新手刚刚入门,各位大佬帮小弟看看是啥问题