警报消息文本的颜色 [英] color of a alert message text

查看:68
本文介绍了警报消息文本的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在javascript函数中有这样的警报消息.

hi all,

I have a alert message like this in javascript function.

alert(' Sec A - Financial Performance :  Draft \n Sec B - Human Resources :  Draft  \n Sec C - Intellectual Property  :  Completed \n');



现在,我想用红色显示草稿中该部分的行.即red color 内部警报消息中的"Sec A - Financial Performance : Draft"行.

我怎样才能做到这一点.. ??

有人可以帮我吗?

问候
Karthik



Now, I want show the line of the section which in draft in red. i.e the line "Sec A - Financial Performance : Draft" in red color inside alert message.

how can i achieve this..??

Can Anyone help me out for this.

regards
Karthik

推荐答案

您将无法使用内置的警报对话框更改颜色.但是,您可以使用模式对话框完成基本相同的操作,使用该对话框可以完全控制样式.
You won''t be able to change the color with the built-in alert dialog. However, you can accomplish essentially the same thing with a modal dialog, which you will have complete control over the style with.


您想要的是一件事,而您拥有的是另外一件事. .为了确保这是正确的方式,足以查看其规范: http://www.w3schools. com/js/js_popup.asp [^ ].

如您所见,没有其他选择.这很容易解释:这些对话框实际上在Web页的外部"运行,但作为OS对话框以Web浏览器的身份运行.它的外观取决于操作系统的显示设置,而不取决于您的代码.

如果要自定义外观并可能需要采取某种行为,则将需要截然不同的方法:通过页面上的HTML元素(使用JavaScript)模拟弹出(模态)对话框行为. jQuery库已经对其UI库进行了补充.

您可以免费下载这些库,并在您的应用程序中使用它们.请参见 http://docs.jquery.com/UI/Dialog [
What you want is one thing, and what you have is something else. To makes sure this is the way it is, its enough to take a look at the specifications: http://www.w3schools.com/js/js_popup.asp[^].

As you can see, no options; and this is easy to explain: those dialogs in fact run "outside" of the Web page, but as an OS dialog box running as owned by a Web browser. It''s appearance depends on OS display settings, not your code.

If you want a custom look and perhaps behavior, you will need radically different approach: simulation of popup (modal) dialog behavior by means of HTML elements on your page working with JavaScript. This is already done in jQuery library complemented by its UI library.

You can freely download these libraries and use them in your application. See http://docs.jquery.com/UI/Dialog[^].

Naturally, you will be able to style the content of the dialog window by usual means of HTML and CSS the way you want.

—SA


使用自定义控件,请参阅此CP文章

ASP.NET弹出控件 [
Use custom controls, see this CP article

ASP.NET Popup Control[^]


这篇关于警报消息文本的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆