javascript online course - Online Tech Support
  Home

JavaScript Introduction

 online tech support  Comments Off on JavaScript Introduction
 

The JavaScript is used in web programming to extend HTML commands and give more flexibility and additional options to solve complicated web page solutions. JavaScript is part of HTML code, but it is not HTML. Read more about HTML on this link.

The first Online Tech Support example shows only a “pure” HTML source without any JavaScript objects.

<html>
  <body>
    <h2>My Web Page</h2>
    </body>
</html>

online tech support online computer help computer technician computer problems computer javascript tutorial javascript learn web design learn javascript courses online javascript online course javascript classes javascript tutorial javascript

You can try this JavaScript If example on this link.

The second JavaScript tutorial example is with the same HTML code above but with additional JavaScript output text that says “Hello JavaScript!” This is your first HTML page using JavaScript method and it writes on the screen. The JavaScript is defined between the script tags that give you an sign that this is not any more just HTML code. To write on screen we are using method write and it applies to object document. The “Hello JavaScript!” text contains both side the p-tags (paragraph) that do belong to HTML but would make the output text look better on a browser screen.

<html>
  <body>
    <h2>My Web Page</h2>

    <script type="text/javascript">
      document.write("<p>Hello JavaScript!</p>");
    </script>

  </body>
</html>

online tech support online computer help computer technician computer problems computer javascript tutorial javascript learn web design learn javascript courses online javascript online course javascript classes javascript tutorial javascript

You can try this JavaScript If example on this link.

Now take a look at our other example on the main screen to try out more JavaScript methods.



See Also:
Home

How To Use Substring In JavaScript

 online tech support  Comments Off on How To Use Substring In JavaScript
 

The JavaScript Substring method allows to extract or cut out a piece of text from the input string. The method has two input parameters “start position” and “end position“. The “start position” parameter is requited and if the “end position” is missing the method takes all way up to the end of string. The syntax of JavaScript Substring is following:

<string_variable>.substring(<start_position>,<end_position>);

On this first JavaScript example below we are declaring a string variable named my_text and we will assign to it value “JavaScript Online Course“. On the following line in the example will cut off the first 11 letter using the JavaScript Substring and the result becomes “Online Course“.

<html>
  <body>
    <h2>My JavaScript Substring Example 1</h2>

    <script type="text/javascript">

      var my_text = "JavaScript Online Course";
      document.write("<p>"+my_text.substring(11)+"</p>");

     </script>

    </body>
</html>

online tech support computer help computer technician computer problems javascript classes javascript substring javascript substring in javascript courses online javascript online course javascript

You can try this example on this link.

To set as well the end position use the position number in the main string as on the following example. It removes the “Course” word from the end leaving only word “Online“.

<html>
  <body>
    <h2>My JavaScript Substring Example 1</h2>

    <script type="text/javascript">

      var my_text = "JavaScript Online Course";
      document.write("<p>"+my_text.substring(11,17)+"</p>");

     </script>

    </body>
</html>

online tech support computer help computer technician computer problems javascript classes javascript substring javascript substring in javascript courses online javascript online course javascript

You can try this example on this link.



See Also:
Home

How To Use String Length In JavaScript

 online tech support  Comments Off on How To Use String Length In JavaScript
 

This tutorial is based on examples to be easier to follow. In JavaScript the Length method is used to get the amount of characters in text. JavaScript length does not have any input parameters and the method is applied to JavaScript variable. The syntax of JavaScript String Length is:

<string_variable>.length;

In this JavaScript Tutorial example we will declare string variable named my_text and we are assigning to it value “JavaScript Online Course“. The all string contains 24 letters and the JavaScript Length returns the same number, see the example below.

<html>
  <body>
    <h2>My JavaScript String Length Example</h2>

    <script type="text/javascript">

      var my_text = "JavaScript Online Course";
      document.write("<p>The length is "+my_text.length+"</p>");

     </script>

    </body>
</html>

online tech support computer help computer technician computer problems javascript classes javascript string length javascript length in javascript string length in javascript courses online javascript online course retirement planning retirement

You can try this example on this link.

See Also:
Home