浏览器问题,按钮上的文字不见了?

java_augur 2005-02-23 10:16:03
笨人正在学习javascript,
在调试了几个例子之后,发现按钮上的文字看不见了,
我怀疑是调试中关闭了哪个选项,(胡乱猜疑)
IE4,比如:<input type="button" value="submit" />
结果页面上只显示一个空白的button.
请指教一下,谢谢!
...全文
385 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
java_augur 2005-02-23
  • 打赏
  • 举报
回复
个人觉得js难就难在兼容问题。现在明白为什么看似简单的js
一本书就1700多页。向每一位scripter致敬!
patchclass 2005-02-23
  • 打赏
  • 举报
回复
IE4?
嗨,找不到这个浏览器了
java_augur 2005-02-23
  • 打赏
  • 举报
回复
恍惚记得就是运行了那个时间显示的程序以后,出现了问题。
实在不好意思,给您添麻烦了。
java_augur 2005-02-23
  • 打赏
  • 举报
回复
<html>
<head>
<title>canHaveChildren Property</title>
<script type="text/javascript">
function colorAll() {
var elems = document.all;
for (var i = 0; i < elems.length; i++) {
elems[i].style.color = "red";
}
}
function colorChildBearing() {
var elems = document.all;
for (var i = 0; i < elems.length; i++) {
if (elems[i].canHaveChildren) {
elems[i].style.color = "red";
}
}
}
</script>
</head>
<body>
<h1>canHaveChildren Property Lab</h1>
<hr />
<form name="input">
<input type="button" value="Color All Elements"
onclick="colorAll()" /><br />
<input type="button" value="Reset" onclick="history.go(0)" /><br />
<input type="button"
value="Color Only Elements That Can Have Children"
onclick="colorChildBearing()" />
</form>
<br />
<hr />
<form name="output">
<input type="checkbox" checked="checked" />Your basic checkbox <input
type="text" name="access2" value="Some textbox text." />
</form>
<table id="myTable" cellpadding="10" border="2">
<tr>
<th>Quantity</th>
<th>Description</th>
<th>Price</th>
</tr>
<tbody>
<tr>
<td width="100">4</td>
<td>Primary Widget</td>
<td>$14.96</td>
</tr>
<tr>
<td>10</td>
<td>Secondary Widget</td>
<td>$114.96</td>
</tr>
</tbody>
</table>
</body>
</html>
java_augur 2005-02-23
  • 打赏
  • 举报
回复
试过了,不是这个问题。<html>
<head>
<title>getExpression(), setExpression(), and recalc() Methods</title>
<style type="text/css">
th {text-align:right}
span {vertical-align:bottom}
</style>
<script type="text/javascript">
var now = new Date();
var shortWidth = 5;
var multiple = 2.5;
function init() {
with (document.all) {
hoursBlock.style.setExpression("width","now.getHours() * shortWidth * multiple","jscript");
hoursLabel.setExpression("innerHTML","now.getHours()","jscript");
minutesBlock.style.setExpression("width","now.getMinutes() * shortWidth","jscript");
minutesLabel.setExpression("innerHTML","now.getMinutes()", "jscript");
secondsBlock.style.setExpression("width","now.getSeconds() * shortWidth","jscript");
secondsLabel.setExpression("innerHTML","now.getSeconds()", "jscript");
}
updateClock();
}
function updateClock() {
now = new Date();
document.recalc();
setTimeout("updateClock()",1000);
}
function showExpr() {
alert("Expression for the \'Hours\' innerHTML property is:\r\n" + document.getElementById("hoursLabel").getExpression("innerHTML") + "."); }
</script>
</head>
<body onload="init()">
<h1>getExpression(), setExpression(), recalc() Methods</h1>
<hr />
<p>This clock uses Dynamic Properties to calculate bar width and time
numbers:</p>
<table border="0">
<tr>
<th>Hours:</th>
<td><span id="hoursBlock" style="background-color:red"></span>
 <span id="hoursLabel"></span></td>
</tr>
<tr>
<th>Minutes:</th>
<td><span id="minutesBlock" style="background-color:yellow"></span>
 <span id="minutesLabel"></span></td>
</tr>
<tr>
<th>Seconds:</th>
<td><span id="secondsBlock" style="background-color:green"></span>
 <span id="secondsLabel"></span></td>
</tr>
</table>
<hr />
<form>
<input type="button" value="Show 'Hours' number innerHTML Expression" onclick="showExpr()" />
</form>
</body>
</html>
这段代码中的button是白板一个。
下面我再贴的这段button则可以正常显示。但我没能观察出二者有何区别?

meizz 2005-02-23
  • 打赏
  • 举报
回复
<input type="button" value="submit"> 这样试试
可能是IE4不支持 < /> 这种关闭对应吧

87,994

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧