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.

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”)

Visit our blog and check out more content!

Do you know the scriptcase tool? No, see all about our tool!

By ,

February 18, 2016

a

You might also like…

AI-Driven Software Development: The Role of ChatGPT

In the rapidly evolving world of technology, artificial intelligence (AI) is playing an increasingl...

Low-Code: The Key to Accessible Digital Transformation

Digital transformation is imperative for companies wishing to remain competitive in the current era...

Low-code: Simplifying Development Without Sacrificing Quality

In today's agile and competitive world, productivity is crucial for the success of any business. Th...

You might also like…

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.