Follow us

Tuesday, October 5, 2010

How to use JavaScript ?

There are three general areas where JavaScript can be placed for use in a webpage.
  1. Inside the head tag
  2. <html>
    <head>
    <title>TechnoScatter - Introduction to JavaScript</title>
    <script type="text/javascript" language="javascript">
                  function Alert()
                        {
    alert("TechnoScatter :: Alert Message Popup");
                        }
    </script>
    </head>
    <body>
    <button id="btnAlert" onclick="Alert();">Alert me </button>
    </body>
    </html>
  3. Within the body tag.
  4. <html>
    <head>
    <title>TechnoScatter - Introduction to JavaScript</title>
    </head>
    <body>
    <button id="btnAlert" onclick="javascript:alert("TechnoScatter :: Alert Message Popup");"> Alert me </button>
    </body>
    </html>
  5. In an external file
  6. <html>
    <head>
    <title>TechnoScatter - Introduction to JavaScript</title>
    <script type="text/javascript" src="path of javascript(it may also be a url)">
    </script>
    </head>
    <body>
    <button id="btnAlert" onclick="FUNCTIONNAME();">Alert me </button>
    </body>
    </html>
Sr.NoTypeDownload Size
1ddddddddddddddddddddddddddddddddddddddddd
1dddddddddddddddSampledddddddddddddd

Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

0 comments: on "How to use JavaScript ?"

Post a Comment