Sunday, August 30, 2015

JAVASCRIPT Part 1

     


         javascript is a programming langauage commonly used in web development. and javascript is a clint-side script langauge,which means the source code is procesed by the clint's web browser rather than on web server.this means javascript function can run after a webpage has loaded without communicating with ther server.

Place of script define

      we can use script tag "<script></script>" in head tags and body tags.

Example One

<!DOCTYPE html>
<html>
<head>
   <title>Javascript</title>
   <script type="text/javacript">
       /*******working here*******/
   </script>
</head>
<body>
</body>

</html>

Example Two

<!DOCTYPE html>
<html>
<head>
   <title>Javascript</title>
</head>
<body>
   <script type="text/javacript">
       /*******working here*******/
   </script>
</body>

</html>

Alert

        An alert is a box that pops ups to give user a message. here's code for an alert that displays the message "Hello Pakistan"

alert('Hello pakistan');

Example One

<!DOCTYPE html>
<html>
<head>
   <title>Javascript</title>
   <script type="text/javacript">
       alert("Hello pakistan");
   </script>
</head>
<body>
       <h1>Hello Pakistan</h1>
</body>
</html>

Example Two

<!DOCTYPE html>
<html>
<head>
   <title>Javascript</title>
</head>
<body>
   <h1>Hello Pakistan</h1>
   <script type="text/javacript">
      alert("Hello Pakistan");
   </script>
</body>
</html>



No comments:

Post a Comment

Swift Start Here