我这测试可用, 可能是你其他HTML写得不规范,
解决方案 »
- 按钮背景图片自适应按钮大小
- 想学好Javascript的必看!
- 各位大虾们帮我看看这个JS,可以得到对象,但是得不到它的值
- 动态资料加入在HTML出现问题…… 关于: response.write"document.write(""内容"");"内的 ' 字符
- 关于加载完成后再执行后面的代码
- 那位大哥帮忙,我想用javascript全选checkbox
- <script>alert('asdf');</script> 问题????????????????
- <span style="position:absolute;witdh:1;height:1;background:black"></span>得到的不是一个点而是一个线,为什么?
- 在javascript中如何得到!鼠标的位置!谢谢了!
- action当中将一个数组userList传过来了 在js中怎么获取这个数组
- js 按纽问题,在线等!
- 谁帮我注释一下代码啊,看不明白!!
<html>
<body>
<form name="form1">
<SELECT id="language" name="language" size="1">
<OPTION selected>English </OPTION>
<OPTION >Simple Chinese </OPTION>
</SELECT>
</form>
<input type="button" value="change" onclick="change_language(this)"/>
</body>
</html>
<script language="javascript">
<!--
var EC=[
["简体中文","Simple Chinese"],
["英文","English"],
["改变","change"],
["定位","Location"],
["联系人","Contact Person"]
];
function change_language(_this){
var select_obj=document.getElementById("language")
var index = -select_obj.selectedIndex + 1;
select_obj.options[0].text = EC[1][index];
select_obj.options[1].text = EC[0][index];
_this.value = EC[2][index];
var div = document.getElementById("t");
for(var i=3; i <EC.length; i++){
var reg = new RegExp(EC[i][select_obj.selectedIndex], "ig");
div.innerHTML = div.innerHTML.replace(reg, EC[i][index]);
}
}
//-->
</script>
<head>
<title>
Dell Grade MFP</title>
</head>
<frameset rows="32,*" border=0>
<frame src="framelogo.htm" name="TopLogo" frameborder=0 scrolling=no noresize>
<frameset cols="220,*" border=0>
<frame src="frameleft.htm" name="TopFrame" frameborder=0 scrolling=auto>
<frameset rows="138,*" border=0>
<frame src="frametop.htm" name="LeftFrame" frameborder=0 scrolling=no noresize>
<frame src="status/status.htm" name="RightFrame" frameborder=0>
</frameset>
</frameset>
</frameset>
</html>
frametop.htm<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE TYPE="text/css"> <!--
body { font-family: Arial, Helvetica, sans-serif, Verdana; margin-left:0; margin-right:0; margin-top:0; margin-bottom:0; }
input { margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; }
select { margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; }
a { color:#0033CC; text-decoration:none }
a:hover, a:active { color:#0033CC; text-decoration:underline }
--> </STYLE>
<title>Dell 2135cn MFP </title>
</head>
<body bgcolor="#FFFFFF" link="#0033CC" alink="#0033CC" vlink="#0033CC">
<style type="text/css">
<!--
body { margin-left:0; margin-right:0; margin-top:0; margin-bottom:0; border-bottom:1px ridge #666666; }
-->
</style>
<div id="t" style="position:absolute; top:0px; left:0px; width:599px; height:140px; overflow:auto">
<table border="0" cellpadding="0" cellspacing="0">
<tr> <td nowrap> <font size=+1 color="#333333"> <b>
Dell 2135cn MFP </b></font> </td> </tr>
<tr> <td nowrap> <font color="#666666">
IPv4: 10.136.4.23 </font> </td> </tr>
<tr> <td> <font color="#666666">
Location: </font> </td> </tr>
<tr> <td> <font color="#666666">
Contact Person: </font> </td> </tr>
</table>
</div>
<div style="position:absolute; top:20px; left:630px; ">
<a href="status/status.htm" target="RightFrame">
<img src="images/D2135cn_01.png" width=100 height=100 border="0"> </a>
</div>
<table style="height:50%; width:50%;"> <tr> <td> </td> </tr> </table> <form name="form1">
<SELECT id="language" name="language" size="1">
<OPTION selected>English </OPTION>
<OPTION >Simple Chinese </OPTION>
</SELECT>
</form>
<input type="button" value="change" onclick="change_language(this)"/>
<script language="javascript">
<!--
var EC=[
["英文","English"],
["简体中文","Simple Chinese"],
["改变","change"],
["定位","Location"],
["联系人","Contact Person"]
];
function change_language(_this){
var select_obj=document.getElementById("language")
var index = -select_obj.selectedIndex + 1;
select_obj.options[0].text = EC[0][index];
select_obj.options[1].text = EC[1][index];
_this.value = EC[2][index];
var div = document.getElementById("t");
for(var i=3; i<EC.length; i++){
var reg = new RegExp(EC[i][select_obj.selectedIndex], "ig");
div.innerHTML = div.innerHTML.replace(reg, EC[i][index]);
}
}
//-->
</script>
</body>
</html>