JavaScript is a language that allows you to inject logic in pages written in HTML (Hypertext Mark-up Language). You have here a brief overview of how JavaScript works in addition to its practical use.

JavaScript logic of the paragraphs may be “loose” or linked to the occurrence of events. Loose paragraphs are executed in the sequence in which they appear on the page (document) and linked to events run only when the event occurs.

Starting with Javascript

 

To enter programming paragraphs within the HTML, you must identify the beginning and end of JavaScript commands, as follows:

<SCRIPT>

Instruction set

</ SCRIPT>

This procedure can be adopted anywhere on the page. However, for better viewing and ease of maintenance, it is recommended that all logic is written in the beginning of the document, through the creation of functions to be invoked when necessary (usually linked to events).

If the logic is written from a particular event, it is not necessary to use the SCRIPT commands.

JavaScript commands are sensitive to the font (capital letter and lower case) in its syntax.

In Javascript, the mathematical operators are widely used:

  • (+) value addition and string concatenation;
  • (-) minus values;
  • (*) multiplication values;
  • (/) values ​​of division;
  • (%) gets the remainder of a division.

Some special controls are also part of languages, they are:

  • b – backspace;
  • f – form feed;
  • n – new line caracters;
  • r – carriage return;
  • t – tab characters;
  • // – comment line;
  • /*….*/ – delimiters to enter text with more than one line as a comment.

Finally, natural delimiters for a string are ‘or’. If necessary the use of these characters as part of the string, it uses the character preceding ‘or’.

Ex: alert (“Beware of using ‘or ‘ in a string”)

You might also like…

PROCESAMIENTO AJAX EN SCRIPTCASE

Ajax en los formularios de Scriptcase puede usarse para recargar un campo de tipo de select basado e...

IMPORTAR IMAGENES DE LA BASE DE DATOS Y UTILIZAR CLASES DE BOOSTRAP

Como muchas personas ya saben, Bootstrap es una biblioteca de front-end libre y de código abierto p...

TENDENCIAS DE DESARROLLO WEB PARA 2017

Usted verá en este post tendencias para 2017 en Diseño Web, en el medio digital y en el desarrollo...

Comment this post

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at sales@scriptcase.net. Learn more about our Privacy Police.