如何设置alert提示框内容的样式 5

<%ifrequest("action")="dl"thenerrs=""ifrequest("yhm")=""thenerrs=errs&"用户名不能为空!\r\n"e... <%
if request("action")="dl" then
errs = ""
if request("yhm")="" then
errs = errs & "用户名不能为空!\r\n"
end if

if errs<>"" then
response.Write("<script>alert("""&errs&""");location.href='chaxun.asp'</script>")
else
if getPwd(request("yhm"))="true" then
session("zpuser") = request("yhm") & ""
response.Write("<script>alert(""恭喜,你已被录取!!!"");location.href='chaxun.asp'</script>")
else
response.Write("<script>alert(""很遗憾,你落榜了!!!"");location.href='chaxun.asp'</script>")
end if
end if
end if

if request("action")="out" then
session("zpuser") = ""
response.Redirect("chaxun.asp")
end if
%>
/////////////////////////////
"<script>alert(""恭喜,你已被录取!!!"");location.href='chaxun.asp'</script>"怎么改,可以修改提示框内的内容
展开
 我来答
prudenss
推荐于2016-10-16 · TA获得超过3441个赞
知道小有建树答主
回答量:1425
采纳率:81%
帮助的人:195万
展开全部
导入3个js 和 1个css,可以通过css改变样式

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery Alert Dialogs</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="description" content="This is a demonstration page." />
<meta name="keywords" content="alert, confirm, prompt, demo" />

<style type="text/css">
BODY,
HTML {
padding: 0px;
margin: 0px;
}
BODY {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
background: #FFF;
padding: 15px;
}

H1 {
font-size: 20px;
font-weight: normal;
}

H2 {
font-size: 16px;
font-weight: normal;
}

FIELDSET {
border: solid 1px #CCC;
-moz-border-radius: 16px;
-webkit-border-radius: 16px;
border-radius: 16px;
padding: 1em 2em;
margin: 1em 0em;
}

LEGEND {
color: #666;
font-size: 16px;
padding: 0em .5em;
}

PRE {
font-family: "Courier New", monospace;
font-size: 11px;
color: #666;
background: #F8F8F8;
padding: 1em;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
}

/* Custom dialog styles */
#popup_container.style_1 {
font-family: Georgia, serif;
color: #A4C6E2;
background: #005294;
border-color: #113F66;
}

#popup_container.style_1 #popup_title {
color: #FFF;
font-weight: normal;
text-align: left;
background: #76A5CC;
border: solid 1px #005294;
padding-left: 1em;
}

#popup_container.style_1 #popup_content {
background: none;
}

#popup_container.style_1 #popup_message {
padding-left: 0em;
}

#popup_container.style_1 INPUT[type='button'] {
border: outset 2px #76A5CC;
color: #A4C6E2;
background: #3778AE;
}

</style>

<!-- Dependencies -->
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.ui.draggable.js" type="text/javascript"></script>

<!-- Core files -->
<script src="jquery.alerts.js" type="text/javascript"></script>
<link href="jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" />

<!-- Example script -->
<script type="text/javascript">

$(document).ready( function() {

$("#alert_button").click( function() {
jAlert('This is a custom alert box', 'Alert Dialog');
});

$("#confirm_button").click( function() {
jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
jAlert('Confirmed: ' + r, 'Confirmation Results');
});
});

$("#prompt_button").click( function() {
jPrompt('Type something:', 'Prefilled value', 'Prompt Dialog', function(r) {
if( r ) alert('You entered ' + r);
});
});

$("#alert_button_with_html").click( function() {
jAlert('You can use HTML, such as <strong>bold</strong>, <em>italics</em>, and <u>underline</u>!');
});

$(".alert_style_example").click( function() {
$.alerts.dialogClass = $(this).attr('id'); // set custom style class
jAlert('This is the custom class called “style_1”', 'Custom Styles', function() {
$.alerts.dialogClass = null; // reset to default
});
});
});

</script>

</head>

<body>

<h1><a href="http://abeautifulsite.net/2008/12/jquery-alert-dialogs/">« jQuery Alert Dialogs (Alert, Confirm, & Prompt Replacements)</a></h1>

<h2>Basic Examples</h2>

<fieldset>
<legend>Alert</legend>
<pre>
jAlert('This is a custom alert box', 'Alert Dialog');
</pre>
<p>
<input id="alert_button" type="button" value="Show Alert" />
</p>
</fieldset>

<fieldset>
<legend>Confirm</legend>
<pre>
jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
jAlert('Confirmed: ' + r, 'Confirmation Results');
});
</pre>
<p>
<input id="confirm_button" type="button" value="Show Confirm" />
</p>
</fieldset>

<fieldset>
<legend>Prompt</legend>
<pre>
jPrompt('Type something:', 'Prefilled value', 'Prompt Dialog', function(r) {
if( r ) alert('You entered ' + r);
});
</pre>
<p>
<input id="prompt_button" type="button" value="Show Prompt" />
</p>
</fieldset>

<h2>Additional Examples</h2>
<fieldset>
<legend>With HTML</legend>
<pre>
jAlert('You can use HTML, such as <strong>bold</strong>, <em>italics</em>, and <u>underline</u>!');
</pre>
<p>
<input id="alert_button_with_html" type="button" value="Show Alert" />
</p>
</fieldset>

<fieldset>
<legend>Alternate Styles</legend>
<p>
By changing the value of the <samp>$.alerts.dialogClass</samp> property (and creating
your own CSS class), you can changes the style of your dialogs:
</p>

<p>
<input id="style_1" class="alert_style_example" type="button" value="Style 1" />
</p>

<p>
View the plugin source for additional properties that can be modifed at runtime.
</p>
</fieldset>

<p>
<a href="http://abeautifulsite.net/2008/09/jquery-context-menu-plugin/">Back to the project page</a>
</p>

</body>

</html>
匿名用户
2015-05-27
展开全部
所需CSS:
<style type="text/css">
#alertMsg {
display: none;
width: 400px;
border: 1px solid #ddd;
border-radius: 5px;
box-shadow: 1px 1px 10px black;
padding: 10px;
font-size: 12px;
position: absolute;
text-align: center;
background: #fff;
z-index: 100000;
}

#alertMsg_info {
padding: 2px 15px;
line-height: 1.6em;
text-align: left;
}

#alertMsg_btn1, #alertMsg_btn2 {
display: inline-block;
background: url(images/gray_btn.png) no-repeat left top;
padding-left: 3px;
color: #000000;
font-size: 12px;
text-decoration: none;
margin-right: 10px;
cursor: pointer;
}

#alertMsg_btn1 cite, #alertMsg_btn2 cite {
line-height: 24px;
display: inline-block;
padding: 0 13px 0 10px;
background: url(images/gray_btn.png) no-repeat right top;
font-style: normal;
}

</style>

使用方法,直接调用函数,传递所需定义的信息,支持定义是否有取消键:
alertMsg(msg, mode)
//mode为空,即只有一个确认按钮,mode为1时有确认和取消两个按钮
追问
这些东西加在什么位置!alertMsg(msg, mode)  写在哪里
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式