Learn Basic Javascript Programming

in #programming7 years ago (edited)

image

Brief description of javascript
Javascript is a scripting language embedded in HTML code and processed on the client side.
With this language, the ability of HTML documents to be more widespread. As the example, using JavaScript is possible to validate inputs on the form before the form is sent to the server.
Javascript is not a Java language and is a different language. Javascript interpreted by the client (the code can be seen on the client side), while the Java code compiled by the programmer and the result of the compilation being run by the client.

JavaScript structure
The structure of JavaScript is as follows:

< SCRIPT LANGUAGE = "JavaScript" > <! - - Writing javascript code // - -> < /SCRIPT> Information : Code <! - - // - ->

generally included with the aim that if the browser does not recognize JavaScript then the browser will treat it as a comment so is not displayed in the browser window.

JavaScript as an object-oriented language Property
Property is an attribute of an object. For example, car objects have car color properties.

Writing:
Name_object.property = value
window.defaultStatus = "Happy Learning JavaScript";

Method
The method is a collection of code used to do something action
against the object.

Writing:
Name_objek.name_method (parameter)
document.write ("Hallo")

The location of JavaScript in HTML
Javascript script in HTML document can be placed on:

  1. Head Section
  2. Body Parts (rarely used).

Here's a simple example of using javascript alerts in HTML pages, to make it please open a text editor like notepad then write the following code and save it with the name basic1.html
< HTML>
< HEAD>
< TITLE> Alert Box < /TITLE>
</ HEAD>
< BODY>
< SCRIPT LANGUAGE = "JavaScript"> <! - window.alert ("This is a message for you"); // -> < /SCRIPT> < /BODY> < /HTML>

after that run using the browser you use.
just so much of our learning today :)

Sort:  

Isn’t this the Java logo?