Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I incorporate a link in a message box in javascript?

Tags:

javascript

I would like to add a link in my javascript messagebox function. 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();
}
like image 787
MrM Avatar asked Jun 08 '09 20:06

MrM


2 Answers

No, this is not supported. You need to create your own modal dialog using an absolutely-positioned DIV.

like image 79
Diodeus - James MacFarlane Avatar answered Oct 22 '22 18:10

Diodeus - James MacFarlane


A javascript framework, such as jQuery, makes this a relatively easy task.

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. They can be easily styled, and also most include pre and post event callback functionality

like image 32
Mark Struzinski Avatar answered Oct 22 '22 19:10

Mark Struzinski