标题:帮忙解决个问题
只看楼主
zaly2008
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-2-13
 问题点数:0 回复次数:0 
帮忙解决个问题

在IE中打开提示缺少对象

<%@ page import="java.util.*" pageEncoding="gb2312"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Trasitional//EN">

<html>
<head>
<title>
this is my forth ajax
</title>
<script language="javascript" type="text/javascript">

function moveup(a)
{
var x=a.parentNode.parentNode;
if(x.previousSibling)move(x,x.previousSibling);
}

function movedown(b)
{
var y=b.parentNode.parentNode;
if(y.nextSibling)move(y,y.nextSibling)move(y,y.nextSibling);
}

function move(new,old)
{
var parent=new.parentNode;
var t1=new.nextSibling;
var t2=new.nextSibling;
if(t1)parent.insertBefore(new,t2);
else parent.appendChild(new);
if(t2)parent.insertBefore(old,t1);
else parent.appendChild(old);
}
</script>
</head>
<body>
<table border="1" id="table">
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td><a href="javascript:void(0)" onclick="moveup(this)">上移</a></td>
<td><a href="javascript:void(0)" onclick="movedown(this)">下移</a></td>
</tr>

<tr>
<td>2</td>
<td>4</td>
<td><a href="javascript:void(0)" onclick="moveup(this)">上移</a></td>
<td><a href="javascript:void(0)" onclick="movedown(this)">下移</a></td>
</tr>

<tr>
<td>2</td>
<td>3</td>
<td><a href="javascript:void(0)" onclick="moveup(this)">上移</a></td>
<td><a href="javascript:void(0)" onclick="movedown(this)">下移</a></td>
</tr>

<tr>
<td>4</td>
<td>5</td>
<td><a href="javascript:void(0)" onclick="moveup(this)">上移</a></td>
<td><a href="javascript:void(0)" onclick="movedown(this)">下移</a></td>
</tr>

<tr>
<td>6</td>
<td>7</td>
<td><a href="javascript:void(0)" onclick="moveup(this)">上移</a></td>
<td><a href="javascript:void(0)" onclick="movedown(this)">下移</a></td>
</tr>
</tbody>
</table>
</body>
</html>

搜索更多相关主题的帖子: parentNode var function java 
2007-02-13 14:10



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-120825-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.968538 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved