Skip to content

Latest commit

 

History

History
60 lines (55 loc) · 2.86 KB

README.md

File metadata and controls

60 lines (55 loc) · 2.86 KB

Web-Development

Basic and advanced module based js.

What js can do ?

  • Build dynamic web pages.
  • Display alert boxes.
  • Write messages to the browser status bar.
  • Control features of the browser.
  • Open new browser windows.
  • Customize reactions to mouse actions and keystrokes.
  • Validate information in forms.
  • Perform calculations.
  • Display tooltips when rolling over objects on the screen.
  • Create interactive forms.
  • Set date and time.
  • Identify browsers and browser plug-ins such as Flash.

What js cannot do ?

  • Write files to the hard disk.
  • Read files from the hard disk -- except for cookies.
  • Close windows other than those the JavaScript applications opened.
  • Write server-side applications, called Common Gateway interface (CGI) applications, which must be written using languages such as Java, PHP, Perl and ASP.
  • Read information from a web page that resides on a domain different from the domian where the javascript code resides.

We will be using these resources to tackle down javascript :

JavaScript O'Really JavaScript demystified JavaScript Mozilla docs

Getting down to JavaScript :

JavaScript Program Anatomy :

  • Objects : are the instantiation of classes and encloses some member functions and member variables (properties or attributes).
  • Properties : are the object's member variables.
  • Methods : are the object's member functions, a fucntion differs from a method that it can have a return and can be assigned to another value, member methods can be accessed from the object using the dot syntax foobar.startRenderer();.
  • Event Handlers : are overridable interfaces with some methods that are used for invoking some actions when something remotely takes place (like listening for sensor's data or button clicks or an analog device).

Spice up :

Copy this code into index.html and run into a browser :

<!DOCTYPE html>
<!-- This is an HTML5 file -->
<html>
<!-- The root element -->
<head>
    <!-- Title, scripts & styles can go here -->
    <title>Spicing Up</title>
</head>
<body>
    <!-- The body holds the content of the document. -->
    <h1>Spice Up !</h1>
    <script language="js" type="text/JavaScript">
      const hello = "Hello World !";
      document.write(hello);
      alert(hello);
  </script>
</body>
</html>