注册 登录
编程论坛 jQuery论坛

帮忙解决个问题

zaly2008 发布于 2007-02-13 14:10, 1354 次点击

在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>

0 回复
1