Tag Archives: Javascript Scripting Tutorial

JQuery & AJAX Selecting & Editing Elements

In this article, I’m going to walk you through some code that I styled with JQuery. You’ll learn:

  • How to select elements in your web page numerous ways
  • How to edit elements in your web page in numerous ways
  • Learn how to monitor event handler’s with JQuery and JavaScript
  • And a bunch more…

Continue reading JQuery & AJAX Selecting & Editing Elements

Javascript Scripting Tutorial: Built in Functions

In this article, I’ll list all of the built in functions available to you with Javascript. While not everything will be covered, I will cover every function that is used on a regular basis. I’m still deciding whether I’ll cover Javascript Graphics or AJAX next. Leave comments below to help me understand. On to the functions.

Javascript Array Functions

In previous articles I described how to create Arrays, but if you forgot here is how you create arrays:

  • var a = new array() // Creates an empty array
  • var b = new array(8) // Creates an array with 8 element cells
  • var c = [1, 2, “turtle”, “number”, true]; // Creates an array with a bunch of random values

Javascript Array Properties and Functions

  • b.length // A property that would return the value of 8, because of the array declaration above
  • c.concat(3,4) // The array c now has the values 1, 2,  “turtle”, “number”, true, 3, 4
  • c.join(“: “) // Returns a string with each element separated by a colon and a space. 1: 2: number: true
  • c.slice(0, 2) // Returns an array which contains all elements between the first value you pass to the second value. In this example you would be returned [1, 2, number]
  • c.sort() // Returns the array elements in alphabetical order. This example returns [1, 2, number, true, turtle]
  • c.toString() // Converts the array into a string and then returns the string.

Continue reading Javascript Scripting Tutorial: Built in Functions

Javascript Scripting Tutorial Pt 5

Error Handling in Javascript

I’ve covered most everything you need to know to program in Javascript except for Error Handling. So, in this article I’ll explain how to handle those nasty errors when they crop up.

An exception is thrown whenever an error occurs in your code. You can set up your code in a way, so that it throws exceptions that you have a pre-built solution for. Let us say one of your functions divides numbers. We all know that dividing into zero produces a result of infinite. So, it would be a good idea to head off a zero division. How would you do that?

You would write some code that throws the exception or error and then catch and respond to such an error. The throw statement follows this style: throw expression;

Normally, the value of the expression is a string that represents what error caused an exception to be thrown. Ex. throw new error(“A division by zero occured”); Continue reading Javascript Scripting Tutorial Pt 5

Javascripts Scripting Tutorial Part 1

[youtube]http://www.youtube.com/watch?v=zhQGj0SWZWY[/youtube]In the Javascripts Free Scripting Tutorial I will completely cover all of the capabilities Javascript offers. Javascript is a scripting language that allows you to make your website more interactive. While HTML provides the structure and CSS provides the styling, Javascript allows you to add functionality to your website that users visitors expect.

I provide a tutorial on How to Use CSS Here and you can Learn How to Write HTML W3C Here.

Introduction to the Scripting Tutorial

In this first article, I’m going to give you a brief overview on how Javascript works. In those articles that follow I will teach by walking you step-by-step through real working Javascript Scripts.I’m going to assume you have read or watched the above HTML and CSS tutorials. Anytime I refer to Javascript Code, I’m talking about a series of commands I am making to the browser. Continue reading Javascripts Scripting Tutorial Part 1