Javascript just offers a simple alert box without any customisation. With the code below u can call a VBscript function from javascript witch makes it possible to create your own alert box with or without an icon.
Javascript function
NS4 = (document.layers);
IE4 = (document.all);
ver4 = (NS4 || IE4);function newAlert(title,mess,icon,mods) {
(IE4) ? makeMsgBox(title,mess,icon,0,0,mods) : alert(mess);
}
VBScript function
Function makeMsgBox(tit,mess,icons,buts,defs,mods)
butVal = buts + (icons*16) + (defs*256) + (mods*4096)
makeMsgBox = MsgBox(mess,butVal,tit)
End Function
Call the new alert box
newAlert(”title”,”msg”,0,0);
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Nov | ||||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | |
One Response
kevin
September 5th, 2007 at 9:48 am
1thx, i have been searching for this code for a long time !
you made my day
RSS feed for comments on this post · TrackBack URI
Leave a reply