我试图通过hspace
根据屏幕分辨率更改属性来更改小程序的水平定位。下面的 Javascript 似乎没有改变任何东西:
<html>
<body>
<applet
id="clientApplet"
archive="client.jar"
code="Client.class"
width="500" height="530"
hspace="100">
</applet>
<br />
<script type="text/javascript">
var leftMargin = (screen.width-500)/2;
document.getElementById("clientApplet").setAttribute(hspace, leftMargin);
window.location.reload()
</script>
</body>
</html>
谁能告诉我哪里出错了?