Javascript Knowledge

  • what is javascript

  • javascript Variable
  • javascript function
  • javascript Event

  • JavaScript If
  • javascript for

  • javascript object
  • Javascript String
  • Javascript Date
  • Javacsript Array
  • Javascript Math

  • Javascript onclick
  • JavaScript onload

  • Javascript Frame
  • Javascript Image
  • Javascript Style
  • Javascript Textarea
  • Javascript Table
  • Javascript window
  • Javascript Location
  • Javacsript form
  • Javascript Checkbox
  • Javascript Input
  • Javascript Radio
  • Javascript Select
  • Javascript Submit

  • Javascript alert
  • Javascript close
  • Javascript confirm
  • Javascript Document open
  • Javascript getElementById
  • Javascript print
  • Javascript reload
  • Javascript remove
  • JavaScript replace
  • Javascript setTimeout
  • JavaScript split
  • JavaScript substring
  • Javascript window open
  • window showmodaldialog

  • Javascript href
  • Javascript IFrame
  • Javascript innerHTML
  • Javascript selectedindex
  • Javascript URL
  • Javascript window Location

  • javascript write to file
  • JavaScript write
  • javascript string to integer
  • Javascript popup
  • Javascript return
  • Javascript Obfuscator
  • Javascript disable
  • Javascript Hide
  • More others

    Javascript
    CSS
    PHP

     

    Javascript popup


    In JavaScript we can create three kinds of popup boxes: Alert box, Confirm box, and Prompt box.

    Alert Box

    An alert box is often used if you want to make sure information comes through to the user.

    When an alert box pops up, the user will have to click "OK" to proceed.

    Syntax:

    alert("sometext")
    Confirm Box

    A confirm box is often used if you want the user to verify or accept something.

    When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed.

    If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.

    Syntax:

    confirm("sometext")
    Prompt Box

    A prompt box is often used if you want the user to input a value before entering a page.

    When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value.

    If the user clicks "OK" the box returns the input value. If the user clicks "Cancel" the box returns null.

    Syntax:

    prompt("sometext","defaultvalue")

    Examples:

    The script needs to be placed in the <head> section of your HTML document.

    <script Language="JavaScript">
    <!--
    function popup(url, name, width, height)
    {
    settings=
    "toolbar=yes,location=yes,directories=yes,"+
    "status=no,menubar=no,scrollbars=yes,"+
    "resizable=yes,width="+width+",height="+height;

    MyNewWindow=window.open("http://"+url,name,settings);
    }
    //-->
    </script>



    Once the script is added to your page, you can open windows using this syntax for the link tags:

    <a href="#" onClick="popup('www.yahoo.com', 'Win1', 300, 300); return false">
    Click Here To Go to Yahoo</a>

     





















     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • Javascript |