是做B/S结构的程序把。可以动态生成网页的时候决定按钮要不要显示的啊,就是把所以的按钮都做上去,然后全部 style="display:none",然后在生成页面的时候把用户的权限放到页面上(比如放到hidden 框里),在页面上的javascript 里面判断对应的hidden里面的值来决定要不要把相应的按钮显示出来button.style.display=""
如:<input type=hidden id=showButton1 value="true">
<button id=button1 style="display:none">test</button>
<script>
if (showButton1.value == "true") button1.style.display="";
</script>以上调试通过
如:<input type=hidden id=showButton1 value="true">
<button id=button1 style="display:none">test</button>
<script>
if (showButton1.value == "true") button1.style.display="";
</script>以上调试通过
解决方案 »
- 过滤相相同的字符后留一个
- 如何用一个按钮的onclick触发ctrl+c ctrl+v等动作?
- 有谁知道googlemap中如何实现路径回放功能的
- [急。。]文一个下拉框和时间的问题。。
- firefox问题,请教高手!
- 一个HTC问题
- 如何将javascript的数字字符转换为数字??(在线等)
- IE5 不支持的事件啊,怎样解决?
- 关于单选按钮的问题!!!!!急!!!!!
- 将一个1M以上的文本信息用js逐行追加到textarea中怎样效率最快
- 我在一个窗口中A,弹出另一个窗口B,然后我在A窗口中的onunload事件中执行"window.opener=null",为何无效???
- 好长时间没有提问了啊,大家来帮我
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body><input type=hidden id=showButton1 value="true">
<button id=button1 style="display:none">test1</button>
<input type=hidden id=showButton2 value="false">
<button id=button2 style="display:none">test2</button>
<input type=hidden id=showButton3 value="true">
<button id=button3 style="display:none">test3</button>
<script>
if (showButton1.value == "true") button1.style.display="";
if (showButton2.value == "true") button2.style.display="";
if (showButton3.value == "true") button3.style.display="";
</script></body>
</html>其中hidden 对象的value由你在服务器端判断了权限以后设置。
var clr = new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F")
function test()
{
var i1 = clr[Math.floor(Math.random()*16)]
var i2 = clr[Math.floor(Math.random()*16)]
var i3 = clr[Math.floor(Math.random()*16)]
var i4 = clr[Math.floor(Math.random()*16)]
var i5 = clr[Math.floor(Math.random()*16)]
var i6 = clr[Math.floor(Math.random()*16)]
document.f.btn.style.backgroundColor=i1+i2+i3+i4+i5+i6
}
</script>
<body onload="test()">
<form name=f>
<input type=button value="测试测试" name=btn>
</form>
这你都搞不顶啊
没加连接怎么能小行啊
在script里面加一行
location.herf=http;//什么东西。什么
<input type=button value="测试测试" name=btn>
</form><script>
var r = Math.floor(Math.random()*256).toString(16)
var g = Math.floor(Math.random()*256).toString(16)
var b = Math.floor(Math.random()*256).toString(16)
col="#"+(r.length<2?"0":"")+r+(g.length<2?"0":"")+g+(b.length<2?"0":"")+b
window.status=col;
document.f.btn.style.backgroundColor=col
</script>