Javascript Popup

Popup messages

 function mypopup1()
 {
  window.open("http://www.google.com", "Shahidwindow",
        "status=yes, height=400, width=500, resizable=yes, menubar=no, left=100, top=10")
 }
 
 function mypopup2()
 {
  window.open("http://www.google.com")
 }
      <script type="text/javascript">
function mypopup1()
{
window.open("http://www.google.com", "Shahidwindow",
"status=yes, height=400, width=500, resizable=yes, menubar=no, left=100, top=10")
}

function mypopup2()
{
window.open("http://www.google.com")
}
</script>

 

 

Javascript Popup

Popup messages

 function mypopup1()
 {
  window.open("http://www.google.com", "Shahidwindow",
        "status=yes, height=400, width=500, resizable=yes, menubar=no, left=100, top=10")
 }
 
 function mypopup2()
 {
  window.open("http://www.google.com")
 }
      <script type="text/javascript">
function mypopup1()
{
window.open("http://www.google.com", "Shahidwindow",
"status=yes, height=400, width=500, resizable=yes, menubar=no, left=100, top=10")
}

function mypopup2()
{
window.open("http://www.google.com")
}
</script>

 

 

Javascript Popup

There are many ways of displaying popup messages using JavaScript, for example alert, confirm, prompt, open

Alert

An alert box will alert user with a message and an OK button.

Syntax of Alert Box

alert(“say something here”)

  • the word alert is a JavaScript keyword
  • you can write any value inside the parenthesis within the double quotes.

Example of Alert Box