Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alert long message

Is there a way to set the height of alert to display really long messages with enabling scrolling option for messages that extends screen height ?

Help would be appreciated , all plugins are not recommended.

like image 419
ProllyGeek Avatar asked Oct 21 '22 18:10

ProllyGeek


2 Answers

You can't control a JavaScript alert box in anyway.

Modern web development uses a modal dialog box to show this type of information.

jQuery UI dialog() is one such popular option. See here: http://jqueryui.com/dialog/

like image 159
Phillip Berger Avatar answered Oct 27 '22 10:10

Phillip Berger


alert() only takes a message and cannot be configured in any way.

I know of no browsers that implement scrolling in the resulting dialog box. Firefox and IE just pop up a modal Windows MessageBox in the OS theme's default dialog font, where Chrome has a little piece of toast that pops up towards the top of the browser window.

You would have to use a floating div to make a sort of fake "dialog box" with the features you want. For example, jQuery dialog, or the excellent alertify.

like image 43
Lightness Races in Orbit Avatar answered Oct 27 '22 11:10

Lightness Races in Orbit