html文件为:
============
<html>
<head>
<style>
BODY {background-color: white}
TD {font-size: 10pt;
font-family: verdana,helvetica;
text-decoration: none;
white-space:nowrap;}
A {text-decoration: none;
color: black}
</style>
<script src='../js/TreeView/ua.js'></script>
<script src='../js/TreeView/ftiens4.js'></script>
<script>
USETEXTLINKS = 1
STARTALLOPEN = 0
HIGHLIGHT = 0
PRESERVESTATE = 1
USEICONS = 0
BUILDALL = 1
function generateCheckBox(parentfolderObject, itemLabel, checkBoxDOMId) {
var newObj;
newObj = insDoc(parentfolderObject, gLnk('R', itemLabel, 'javascript:parent.op()'))
newObj.prependHTML = '<td valign=middle><input type=checkbox id='+checkBoxDOMId+'></td>'}
foldersTree = gFld('设备副类构成:', 'SheBeiZhu.jsp')
foldersTree.treeID = 'checkboxTree'
aux133= insFld(foldersTree, gFld('转辙机'))
aux140= insFld(aux133, gFld('电液转辙机'))
generateCheckBox(aux140, 'ZY6', 'aux145')
aux141= insFld(aux133, gFld('电动转辙机'))
generateCheckBox(aux141, 'ZD7', 'aux144')
generateCheckBox(aux141, 'ZD6', 'aux143')
generateCheckBox(aux133, '快速转辙机', 'aux142')
aux134= insFld(foldersTree, gFld('继电器'))
generateCheckBox(aux134, '差分式继电器', 'aux148')
generateCheckBox(aux134, '二元继电器', 'aux149')
aux135= insFld(foldersTree, gFld('移频设备'))
aux137= insFld(foldersTree, gFld('轨道电路'))
aux138= insFld(foldersTree, gFld('信号机'))
aux139= insFld(foldersTree, gFld('控制台'))
aux136= insFld(foldersTree, gFld('电源屏'))
function generateQueryString()
{
var retStr;
retStr = retStr + '&aux145=' + getElById('aux145').checked
retStr = retStr + '&aux144=' + getElById('aux144').checked
retStr = retStr + '&aux143=' + getElById('aux143').checked
retStr = retStr + '&aux142=' + getElById('aux142').checked
retStr = retStr + '&aux148=' + getElById('aux148').checked
retStr = retStr + '&aux149=' + getElById('aux149').checked
return retStr }
function submitTreeForm() {
window.open('SheBeiZhu.jsp?' + generateQueryString(),'zhu')
}
</script>
<title>Checkbox Tree JavasScript</title>
</head>
<body topmargin=16 marginheight=16>
<div style='position:absolute; top:0; left:0; '><table border=0><tr><td><font size=-2><a style=font-size:7pt;text-decoration:none;color:silver href=http://www.treemenu.net/ target=_blank></font></td></tr></table></div>
<form name=ft method=''>
<script>initializeDocument()</script>
<BR><BR>
<CENTER><input type=button onClick='submitTreeForm()' value='确 定'></CENTER>
</form>
</html>
=====================
在http://localhost:8080/文件名,打开的时候,就提示“缺少对象”!!
急!
============
<html>
<head>
<style>
BODY {background-color: white}
TD {font-size: 10pt;
font-family: verdana,helvetica;
text-decoration: none;
white-space:nowrap;}
A {text-decoration: none;
color: black}
</style>
<script src='../js/TreeView/ua.js'></script>
<script src='../js/TreeView/ftiens4.js'></script>
<script>
USETEXTLINKS = 1
STARTALLOPEN = 0
HIGHLIGHT = 0
PRESERVESTATE = 1
USEICONS = 0
BUILDALL = 1
function generateCheckBox(parentfolderObject, itemLabel, checkBoxDOMId) {
var newObj;
newObj = insDoc(parentfolderObject, gLnk('R', itemLabel, 'javascript:parent.op()'))
newObj.prependHTML = '<td valign=middle><input type=checkbox id='+checkBoxDOMId+'></td>'}
foldersTree = gFld('设备副类构成:', 'SheBeiZhu.jsp')
foldersTree.treeID = 'checkboxTree'
aux133= insFld(foldersTree, gFld('转辙机'))
aux140= insFld(aux133, gFld('电液转辙机'))
generateCheckBox(aux140, 'ZY6', 'aux145')
aux141= insFld(aux133, gFld('电动转辙机'))
generateCheckBox(aux141, 'ZD7', 'aux144')
generateCheckBox(aux141, 'ZD6', 'aux143')
generateCheckBox(aux133, '快速转辙机', 'aux142')
aux134= insFld(foldersTree, gFld('继电器'))
generateCheckBox(aux134, '差分式继电器', 'aux148')
generateCheckBox(aux134, '二元继电器', 'aux149')
aux135= insFld(foldersTree, gFld('移频设备'))
aux137= insFld(foldersTree, gFld('轨道电路'))
aux138= insFld(foldersTree, gFld('信号机'))
aux139= insFld(foldersTree, gFld('控制台'))
aux136= insFld(foldersTree, gFld('电源屏'))
function generateQueryString()
{
var retStr;
retStr = retStr + '&aux145=' + getElById('aux145').checked
retStr = retStr + '&aux144=' + getElById('aux144').checked
retStr = retStr + '&aux143=' + getElById('aux143').checked
retStr = retStr + '&aux142=' + getElById('aux142').checked
retStr = retStr + '&aux148=' + getElById('aux148').checked
retStr = retStr + '&aux149=' + getElById('aux149').checked
return retStr }
function submitTreeForm() {
window.open('SheBeiZhu.jsp?' + generateQueryString(),'zhu')
}
</script>
<title>Checkbox Tree JavasScript</title>
</head>
<body topmargin=16 marginheight=16>
<div style='position:absolute; top:0; left:0; '><table border=0><tr><td><font size=-2><a style=font-size:7pt;text-decoration:none;color:silver href=http://www.treemenu.net/ target=_blank></font></td></tr></table></div>
<form name=ft method=''>
<script>initializeDocument()</script>
<BR><BR>
<CENTER><input type=button onClick='submitTreeForm()' value='确 定'></CENTER>
</form>
</html>
=====================
在http://localhost:8080/文件名,打开的时候,就提示“缺少对象”!!
急!
=======
/*
* $Log: ua.js,v $
* Revision 1.9 2002/07/22 14:06:21 bc6ix
* fix license path, change version reporting to use 2 digits for each level
*
* Revision 1.8 2002/07/07 08:23:07 bc6ix
* fix line endings
*
* Revision 1.7 2002/05/14 16:52:52 bc6ix
* use CVS Log for revision history
*
*
*//* ***** BEGIN LICENSE BLOCK *****
* Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1
* Full Terms at http://bclary.com/lib/js/license/mpl-tri-license.txt
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Netscape code.
*
* The Initial Developer of the Original Code is
* Netscape Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Bob Clary <[email protected]>
*
* ***** END LICENSE BLOCK ***** */function xbDetectBrowser()
{
var oldOnError = window.onerror;
var element = null; window.onerror = null;
// work around bug in xpcdom Mozilla 0.9.1
window.saveNavigator = window.navigator; navigator.OS = '';
navigator.version = parseFloat(navigator.appVersion);
navigator.org = '';
navigator.family = ''; var platform;
if (typeof(window.navigator.platform) != 'undefined')
{
platform = window.navigator.platform.toLowerCase();
if (platform.indexOf('win') != -1)
navigator.OS = 'win';
else if (platform.indexOf('mac') != -1)
navigator.OS = 'mac';
else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1)
navigator.OS = 'nix';
} var i = 0;
var ua = window.navigator.userAgent.toLowerCase();
if (ua.indexOf('safari') != -1)
{
i = ua.indexOf('safari');
navigator.family = 'safari';
navigator.org = 'safari';
navigator.version = parseFloat('0' + ua.substr(i+7), 10);
}
else if (ua.indexOf('opera') != -1)
{
i = ua.indexOf('opera');
navigator.family = 'opera';
navigator.org = 'opera';
navigator.version = parseFloat('0' + ua.substr(i+6), 10);
}
else if ((i = ua.indexOf('msie')) != -1)
{
navigator.org = 'microsoft';
navigator.version = parseFloat('0' + ua.substr(i+5), 10);
if (navigator.version < 4)
navigator.family = 'ie3';
else
navigator.family = 'ie4'
}
else if (ua.indexOf('gecko') != -1)
{
navigator.family = 'gecko';
var rvStart = ua.indexOf('rv:');
var rvEnd = ua.indexOf(')', rvStart);
var rv = ua.substring(rvStart+3, rvEnd);
var rvParts = rv.split('.');
var rvValue = 0;
var exp = 1; for (var i = 0; i < rvParts.length; i++)
{
var val = parseInt(rvParts[i]);
rvValue += val / exp;
exp *= 100;
}
navigator.version = rvValue; if (ua.indexOf('netscape') != -1)
navigator.org = 'netscape';
else if (ua.indexOf('compuserve') != -1)
navigator.org = 'compuserve';
else
navigator.org = 'mozilla';
}
else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1))
{
var is_major = parseFloat(navigator.appVersion);
if (is_major < 4)
navigator.version = is_major;
else
{
i = ua.lastIndexOf('/')
navigator.version = parseFloat('0' + ua.substr(i+1), 10);
}
navigator.org = 'netscape';
navigator.family = 'nn' + parseInt(navigator.appVersion);
}
else if ((i = ua.indexOf('aol')) != -1 )
{
// aol
navigator.family = 'aol';
navigator.org = 'aol';
navigator.version = parseFloat('0' + ua.substr(i+4), 10);
}
else if ((i = ua.indexOf('hotjava')) != -1 )
{
// hotjava
navigator.family = 'hotjava';
navigator.org = 'sun';
navigator.version = parseFloat(navigator.appVersion);
} window.onerror = oldOnError;
}xbDetectBrowser();