Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link in Javascript alert

I want to put a link in a Javascript alert.

Is this possible? (I've searching for a solution, but I keep getting things about links that fire alerts!)

like image 911
user5243421 Avatar asked Nov 14 '09 05:11

user5243421


2 Answers

AFAIK you can't do that with a normal javascript alert box.

Make a custom alert box and then make a link inside it.

Here is a nice one

YUI: Dialog Alert Widget

Also a jQuery based one

jQuery Impromptu

like image 123
rahul Avatar answered Oct 21 '22 12:10

rahul


Nope. Only standard OS dialog boxes are available (alert, input, etc.), and none support embedded hyperlinks.

You can could a pop-up window that is styled to look like a dialog, but pop-up windows are likely to have various user blocks, etc. in place.

My advice is to use a an absolutely-positioned DIV with a high z-order centered on your page that looks like a dialog box and put whatever you want in it. Various UI toolkits like JQuery UI take the pain out of this.

like image 39
richardtallent Avatar answered Oct 21 '22 11:10

richardtallent