如何在页面上弹出一个消息框??

tongtianxiao 2010-07-15 04:56:19
如何在页面上弹出一个消息框??
...全文
245 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
enderboy520 2010-07-16
  • 打赏
  • 举报
回复
有一種方法 叫GOOGLE
KLL 2010-07-16
  • 打赏
  • 举报
回复
jfzr
fxsy6669 2010-07-16
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 rewoshengqi 的回复:]
window.open()
alert()
showmodaldialog()
具体要什么样的窗口
楼主说明白
[/Quote]
还有其它方法,百度一下。
zlchina1989 2010-07-15
  • 打赏
  • 举报
回复
response.write("<Script language='javascript'>alert('警告信息')</script>");
tackey86 2010-07-15
  • 打赏
  • 举报
回复
一般在页面上弹窗口都是用脚本弹了
alert("123")
confirm("123")
如果要好看点就是用DIV让他显示在顶层
暖枫无敌 2010-07-15
  • 打赏
  • 举报
回复
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>可以拖动和隐藏的层,可替代弹出窗口</title>

<script language="JavaScript" type="text/javascript">

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
topDog=isIE ? "BODY" : "HTML";
whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");
hotDog=isIE ? event.srcElement : e.target;
while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
}
if (hotDog.id=="titleBar"){
offsetx=isIE ? event.clientX : e.clientX;
offsety=isIE ? event.clientY : e.clientY;
nowX=parseInt(whichDog.style.left);
nowY=parseInt(whichDog.style.top);
ddEnabled=true;
document.onmousemove=dd;
}
}

function dd(e){
if (!ddEnabled) return;
whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx;
whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
return false;
}

function ddN4(whatDog){
if (!isN4) return;
N4=eval(whatDog);
N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
N4.onmousedown=function(e){
N4.captureEvents(Event.MOUSEMOVE);
N4x=e.x;
N4y=e.y;
}
N4.onmousemove=function(e){
if (isHot){
N4.moveBy(e.x-N4x,e.y-N4y);
return false;
}
}
N4.onmouseup=function(){
N4.releaseEvents(Event.MOUSEMOVE);
}
}

function hideMe(){
if (isIE||isNN) whichDog.style.visibility="hidden";
else if (isN4) document.theLayer.visibility="hide";
}

function showMe(){
if (isIE||isNN) whichDog.style.visibility="visible";
else if (isN4) document.theLayer.visibility="show";
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");

</script>

</head>
<body>
<div id="theLayer" style="position:absolute;width:250px;left:100;top:100;visibility:visible">
<table border="0" width="250" bgcolor="#424242" cellspacing="0" cellpadding="5">
<tr>
<td width="100%">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="36">
<tr>
<td id="titleBar" style="cursor:move" width="100%">
<ilayer width="100%" onSelectStart="return false">
<layer width="100%" onMouseover="isHot=true;if (isN4) ddN4(theLayer)" onMouseout="isHot=false">
<font face="Arial" color="#FFFFFF">Layer Title</font>
</layer>
</ilayer>
</td>
<td style="cursor:hand" valign="top">
<a href="#" onClick="hideMe();return false"><font color=#ffffff size=2 face=arial style="text-decoration:none">X</font></a>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF" style="padding:4px" colspan="2">
This is where your content goes.<br>
It can be any html code or text.<br>
Remember to feed the reindeer.<br>
Avoid chewable giblet curtains.
<!-- END OF CONTENT AREA //-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<a href="javascript:showMe();">显示</a>
<a href="javascript:hideMe();">隐藏</a>
</body>
</html>
tongtianxiao 2010-07-15
  • 打赏
  • 举报
回复
从后台c#里如何弹出确认对话框?
isaced 2010-07-15
  • 打赏
  • 举报
回复
方法很多呀!!!!
bobo_msdn 2010-07-15
  • 打赏
  • 举报
回复
Response.Write("<script>alert('添加成功!');</script>");
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加成功');</script>");

顶楼上!
jenny1004 2010-07-15
  • 打赏
  • 举报
回复
有很多方式,你是不是要的QQ里的那种啊?
Purple_Sky2010 2010-07-15
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 lo_back___ 的回复:]
alert("消息")
confirm("确认取消?")
[/Quote]

楼上的都对的,不知道楼主解决了没
y2zhaocaihong 2010-07-15
  • 打赏
  • 举报
回复
Response.Write("<script>alert('你需要的信息!');</script>");
xcaihong 2010-07-15
  • 打赏
  • 举报
回复
response.write("<script>alert('aaaaaa');window.location.href='default.aspx';</script>");
  • 打赏
  • 举报
回复
方法多多、 至少也是7、8种
chen3002min 2010-07-15
  • 打赏
  • 举报
回复
Response.Write("<script>alert('出了!');</script>");
这个种不会把页面排版搞乱
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('出了');</script>");
zlwork_84 2010-07-15
  • 打赏
  • 举报
回复
上面几楼都是正解。多Google,可以节省分数。呵呵。
aluogang 2010-07-15
  • 打赏
  • 举报
回复
Response.Write("<script>alert('添加成功!');</script>");
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加成功');</script>");
z408638923 2010-07-15
  • 打赏
  • 举报
回复
服务器可以用response.write("<script>alert('')</script>")
页面用alert('')
lo_back___ 2010-07-15
  • 打赏
  • 举报
回复
alert("消息")
confirm("确认取消?")
lsdsjy 2010-07-15
  • 打赏
  • 举报
回复
alert("");
加载更多回复(3)

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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