<SCRIPT language=javascript>
if (top.location != self.location) {
document.all("soft").width="100%"}
else{
document.all("soft").width="770"}
</script>
<talbe id="soft">
<tr>
<td>aa</td>
</tr>
</table>
<talbe id="soft">
<tr>
<td>bb</td>
</tr>
</table>
if (top.location != self.location) {
document.all("soft").width="100%"}
else{
document.all("soft").width="770"}
</script>
<talbe id="soft">
<tr>
<td>aa</td>
</tr>
</table>
<talbe id="soft">
<tr>
<td>bb</td>
</tr>
</table>
我在ie6下出错,提示"document.all(...)'为空或不是对象
1.table打成talbe了-_-2.两个表格都起名叫soft??
<tr>
<td>aa</td>
</tr>
</table>
<table id="soft1" border=1>
<tr>
<td>bb</td>
</tr>
</table>
<SCRIPT language=javascript>
if (top.location != self.location) {
soft.width="200"
} else {
soft.width="100"
}
</script>
其中:
1.id是不能重名的,你如果要对多个id发生作用,建议用循环+eval做。
2.就写成soft.width就可以了。但是最好把这个命令写在id=soft的后面,反正script放什么地方都可以的。
3.其实用你起初的self!=top就可以了......(表汗-_\\)问题完全出在你后面的代码上。
1.table打成talbe了-_-2.两个表格都起名叫soft??是笔误啦,我自己机上的文件是table。
那个script放在id=soft后面是正解