简体   繁体   English

我可以在javascript的消息框中加入一个链接吗?

[英]Can I incorporate a link in a message box in javascript?

I would like to add a link in my javascript messagebox function. 我想在我的javascript messagebox函数中添加一个链接。 Is there a way to do that? 有没有办法做到这一点?

TodayDate = new Date();
if (sender._selectedDate < new Date(TodayDate.getYear(), TodayDate.getMonth()-1, 1)) 
{
alert("Only current and previous months active.\n\nPlease visit\n
Agency ...HOMEPAGE...\nfor Archive Commissions");
sender._selectedDate = new Date();
}

No, this is not supported. 不,这不受支持。 You need to create your own modal dialog using an absolutely-positioned DIV. 您需要使用绝对定位的DIV创建自己的模态对话框。

A javascript framework, such as jQuery , makes this a relatively easy task. 一个javascript框架,比如jQuery ,使这个任务变得相对简单。

There are several jQuery plugins that allow you to create a div with your dialog content on the page, and that div becomes a JavaScript dialog when the show dialog event fires. 有几个jQuery插件允许您在页面上创建带有对话框内容的div,并且当show对话框事件触发时,该div将成为JavaScript对话框。 They can be easily styled, and also most include pre and post event callback functionality 它们可以轻松设置样式,并且大多数还包括事件前和事件后回调功能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以在 SAP UI5 的标准消息框中提供链接吗? - Can I give a link in standard message box in SAP UI5? 如何在Javascript中向用户显示是/否消息框? - How can I display a yes/no message box to the user in Javascript? 如何将我的JavaScript合并到网页中? - How can I incorporate my javascript with my webpage? Javascript - 如何扩展此脚本以包含另一个类更改? - Javascript - How can I extend this script to incorporate another class change? 使用 javascript 制作搜索框并包含 CSV - Making a search box using javascript and incorporate a CSV 单击联系表单的链接时,如何使用javascript允许用户自动选择复选框? - How can I use javascript to allow user to select a check box automatically when clicking a link to contact form? 如何使用ASP.NET添加客户端(JavaScript)确认消息框? - How can I add a client-side (JavaScript) confirmation message box using ASP.NET? JavaScript:当他们关闭浏览器时,如何提示自定义消息框? - JavaScript: How can I prompts a custom message box when they close broswer? Javascript null合并帮助,如何合并阈值? a = b || c但如果b&gt; d,请选择c - Javascript null coalescing help, how can I incorporate a threshold value? a = b || c but if b > d, choose c 如何在链接中找到消息 - How can I find a message in a link
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM