首先,各位大虾不许笑。我要提问了 。
用alert方法弹出的对话框,可不可以把“确定”改成其他字。是用纯HTML。
无聊事想的东西。。。试了很多方法都不行。。
问题补充: 感谢楼上几位指导,我是想在html里做这个功能,不知道几位说的方法可不可以,如果可以,能不能麻烦给个例子
你看看这个帖子;http://fengshen-xia.iteye.com/admin/blogs/295161
就是一个简单精美的类似alert的提示框
那就不能用alert了,必须自己实现一个对话框,就是一个js弹出层,现在很火的Ext.js就有这个功能,你也可以上网找找很多的。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
w3c, web standards, visual, display, java, javascript, c++, php, jsp, asp, py, pl" />
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
window.alert = function(txt) { var shield = document.createElement("DIV"); shield.id = "shield"; shield.style.position = "absolute"; shield.style.left = "0px"; shield.style.top = "0px"; shield.style.width = "100%"; shield.style.height = document.body.scrollHeight+"px"; shield.style.background = "#333"; shield.style.textAlign = "center"; shield.style.zIndex = "10000"; shield.style.filter = "alpha(opacity=0)"; var alertFram = document.createElement("DIV"); alertFram.id="alertFram"; alertFram.style.position = "absolute"; alertFram.style.left = "50%"; alertFram.style.top = "50%"; alertFram.style.marginLeft = "-225px"; alertFram.style.marginTop = "-75px"; alertFram.style.width = "450px"; alertFram.style.height = "150px"; alertFram.style.background = "#ccc"; alertFram.style.textAlign = "center"; alertFram.style.lineHeight = "150px"; alertFram.style.zIndex = "10001"; strHtml = "<ul style=\"list-style:none;margin:0px;padding:0px;width:100%\">\n"; strHtml += " <li style=\"background:#DD828D;text-align:left;padding-left:20px;font- size:14px;font-weight:bold;height:25px;line-height:25px;border:1px solid #F9CADE;\">[系统提示] </li>\n"; strHtml += " <li style=\"background:#fff;text-align:center;font-size:12px;height:120px;line -height:120px;border-left:1px solid #F9CADE;border-right:1px solid #F9CADE;\">"+txt+"</li>\n"; strHtml += " <li style=\"background:#FDEEF4;text-align:center;font- weight:bold;height:25px;line-height:25px; border:1px solid #F9CADE;\"><input type=\"button\" value=\"关 闭\" onclick=\"doOk()\" /></li>\n"; strHtml += "</ul>\n"; alertFram.innerHTML = strHtml; document.body.appendChild(alertFram); document.body.appendChild(shield); var c = 0; this.doAlpha = function(){ if (c++ > 20){clearInterval(ad);return 0;} shield.style.filter = "alpha(opacity="+c+");"; } var ad = setInterval("doAlpha()",5); this.doOk = function(){ window.close(); } alertFram.focus(); document.body.onselectstart = function(){return false;}; }用alert方法弹出的对话框,可不可以把“确定”改成其他字
这样就不能用它原始的alert,需要你自己设计,要不用一些开源框架,如:ext,echo2等
要不你就用js+div来实现这个功能.
都可以的阿,js+div的例子我这里是有个
需要留下联系方式