当前位置:首页 » 网页前端 » web里的alert能显示哪些
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

web里的alert能显示哪些

发布时间: 2022-09-04 00:55:37

❶ alert,confirm与prompt的用法,各自属于什么客户端

Asp.net中,有的时候在执行某个操作的时候希望能够弹出一些信息框:alert弹出的警告信息框,confirm弹出的包含确认和取消两个按钮的信息框,以及prompt弹出的输入数据的对话框。
这里有两种方法来实现。
一种是采用javascript函数来实现,代码将应用与.aspx文件的源代码(html语言)中,在HTML控件中调用javascript函数来实现Alert、Confirm、Prompt。
另一种则是在web窗体的.aspx.cs文件中使用。alert和prompt可以用Response.Write()来直接使用,Confirm则需要将其加入到Web服务器控件的属性上。下面我们就分别针对这两种方法来举几个例子。1、我们创建两个HTML按钮来分别调用javascript函数,一个按钮用来弹出confirm信息框,另一个用来弹出prompt信息框,操作结果用alert弹出。
<html>
<head>
<title>曙光博客</title>
<script language="ecmascript">
<!--
function delCheck()
{
var flag=window.confirm("确实要删除吗?");
if(flag==true)
alert("已经删除!");
}
function dataCheck()
{
var data=window.prompt("输入一个1-10之间的数","7");
if(data!=null)
alert("你输入的是:"+data);
}
//-->
</script>
</head>
<body>
<form id="form1">
<input name="del" type="button" id="Button2" value="删除记录" onclick="delCheck()">
<input name="in" type="button" id="in" value="输入数据" onclick="dataCheck()">
</form>
</body>
</html>2、在ASP.NET的.aspx.cs文件中使用:
(1)Alert的使用:Response.Write("<script>alert('密码不正确!')</script>");(2)Confirm的使用:点击Button3按钮的是否,弹出confirm对话框,选择"确定"的时候则开始执行相应的按钮操作。
在page_load添加如下代码:protected void Page_Load(object sender, EventArgs e)
{
Button3.Attributes.Add("onclick ", "return confirm( '确认要修改吗?');");
}
protected void Button3_Click(object sender, EventArgs e)
{
//Button3的按钮操作,可自行定义
Response.Write("您选择的是确定操作!");
}(3)Prompt的使用:Response.Write("<script> var result=window.prompt('请输入新文件名:)' , 'ABC'); if(result!=null) alert('你输入的是'+result);</script>");本文来自CSDN博客,转载请标明出处: http://blog.csdn.net/cnrefresh/archive/2009/04/27/4129911.aspx

❷ 在javascript中,alert()是什么意思请具体介绍一下吧!谢谢

alert在英语中的意思是警告,javascript中,alert()是弹出警告框的意思。

❸ java web中怎么实现javascript的alert功能

是在JSP页面中嵌入Jscript代码。
因为javascript是弱类型语言,只能在客户端运行的。

❹ web java jsp 页面我用alert("您还未登录,请您点击确定登录");如果没有登录则弹出如下图

不可以改变,标题是不行的,想要弹框美观都不用alert就可以了,显示一个精心设计美观的DIV,也有一个确认按钮,这样就可以任意设计了,想有什么都可以的。

❺ 如何设置WebView支持js的Alert,Confirm,Prompt函数的弹出提示框

如何设置WebView支持js的Alert,Confirm,Prompt函数的弹出提示框
弹出提示框一般有3种
1)alert (普通提示框)
2)prompt (可输入的提示框)
3)confirm (可选择的提示框)

下面举个例子:
<!doctype html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body><button onclick="mal()">第一种:alert</button><button onclick="mpro()">第二种:prompt</button><button onclick="mcon()">第三种:confirm</button><script> function mal(){ alert('这是一个普通的提示框'); } function mpro(){ var val = prompt('这是一个可输入的提示框','这个参数为输入框默认值,可以不填哦'); //prompt会把输入框的值返回给你 } function mcon(){ var boo = confirm('这是一个可选择的提示框,3种提示方式,学会了吗?') //confirm 会返回你选择的选项,然后可以依据选择执行逻辑 if(boo){ alert('学会了,真聪明'); }else{ alert('再来一遍吧') } }</script></body></html>

❻ 网页alert对话框

不用alert(),用window.showmodelDialog().这样你别说改字了,你就加图片都没有问题,我的思路是,弹出一个子完全窗体,你设置一 下子窗体的属性,改成弹出对话框大不差不多的,你再随便那么一改,OK了
代码:
在你要弹出的页面写如下方法
<script language="javascript">
function show()
{
var sta="dialogWidth:310px;dialogHeight:110px;status:no;help:no";
window.showModalDialog("2.html",window,sta);
}
</script>
<body onload="show();">
</body>

2.html文件代码
<head>
<title>
Wrong
</title>
</head>
<body>
<table align=center valign="bottom">
<tr>
<td>
这是你要的吗?你还可以加图片啊!
</td>
</tr>
<tr align=center>
<td><input type="button" name="sb" value="Yes"/></td>
</tr>
</table>
</body>
你试试吧,还不赖!

❼ webform怎么给出alert提示

你可以直接引用System.Windows.Forms然后
MessageBox.Show("Message");
能弹出对话框,但是经常被浏览器挡在后面,即使设置TopMost,也不行。
其他的方法就是用JS了,
Response.Write("<script>alert(\""+message+"\")</script>");

❽ 微信web开发 alert 能输入信息吗

alert('不能再减了');
}

});

$('#plus').click(function(){
var num=$('#cart_shopnum').val();

if(num<99){
num = num*1+1*1;
$('#cart_shopnum').val(num);
}else{
alert('不能再加了');
}