• Check out world news on HeadLinesList.com
  • Forum registration is now open for public.
Hello There, Guest! Login

Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Javascript Pop-up error Window?
How do you make a window in javascript that pops up like an error window?
How do you make a Javascript that makes an error window pop-up when you visit a website? I'm talking about one of those grey windows with the OK button and the stop sign on the left side. I've done it before but I forget how to.


Here is how to do it in JavaScript as you requested:

Put this in the body of your html page.

<BODY onLoad="window.alert('Insert your message here!');">

It can also be done in VBScript with message boxes, which are more customizable.

Begin by inserting this script into the head or body of your page:

<script type="text/vbscript">
MsgBox "Insert your message here!"

To customize it, go to the website I have listed below for directions.


<script language="vbscript">
Sub button1_onClick()
MsgBox "Function Under Construction!",16
End Sub
<button id="button1">Submit</button>


MsgBox(prompt[, buttons][, title][, helpfile, context])

Constant Value Description
vbOKOnly 0 Display OK button only.
vbOKCancel 1 Display OK and Cancel buttons.
vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons.
vbYesNoCancel 3 Display Yes, No, and Cancel buttons.
vbYesNo 4 Display Yes and No buttons.
vbRetryCancel 5 Display Retry and Cancel buttons.
vbCritical 16 Display Critical Message icon.
vbQuestion 32 Display Warning Query icon.
vbExclamation 48 Display Warning Message icon.
vbInformation 64 Display Information Message icon.
vbDefaultButton1 0 First button is default.
vbDefaultButton2 256 Second button is default.
vbDefaultButton3 512 Third button is default.
vbDefaultButton4 768 Fourth button is default.
vbApplicationModal 0 Application modal; the user must respond to the message box before continuing work in the current application.
vbSystemModal 4096 System modal; all applications are suspended until the user responds to the message box.

Constant Value Button
vbOK 1 OK
vbCancel 2 Cancel
vbAbort 3 Abort
vbRetry 4 Retry
vbIgnore 5 Ignore
vbYes 6 Yes
vbNo 7 No

Forum Jump:

1 Guest(s)