Thursday, October 30, 2014

Lesson 6: JavaScript Events, Functions and Methods

Hello everyone

This week we will be discussing JavaScript Events, Functions and Methods.
First we will discuss functions. Function is a named set of statements that performs a task or calculates a value. Functions are fundamental tools in JavaScript. By plugging data into a function, a value will return either to the screen, to a variable, or to another function. Functions enable you to write code and place it into a single unit that can perform a specific task repeatedly throughout the program, as needed in order to use functions effectively,you must know how to:
• Define (or declare) functions.
• Pass arguments to them.
• Call them.
• Return function results.
Defining function:You define a function when you encompass a group of script statements into a function block.
Pass argument to them: The curly braces must encompass any statements that are to execute as part of that function. This statement is known as argument.
Argument: a value or expression containing data or code that is passed on to a function or procedure. Also called a parameter.
Call them: A function's statements are processed when the function is called

Calling Statement: a statement that transfers program execution to a subroutine, procedure or function. Return function results: ends function execution and specifies a value to be returned to the function caller.
Whether they are submitting forms or navigating Web pages, users generate events. JavaScript contains predetermined event handlers that deal with these events. Some of these are mouseOver, mouseOut, reset, select, submit, unload.


The next thing we will discuss is Methods. Methods are what the objects in Javascript can do.

Errors In JavaScript Load-time errors 
In relation to a computer programming, scripting or markup language, a "bug" is an error in the code. There are several types of bugs:
Commonly called compiler or interpreter errors, these are typically syntax errors. Load-time errors usually cause error alerts.
 Run-time errors — After the script has loaded and is running, an error occurs. These are typically caused by improper use of commands. Run-time errors usually cause error alerts as well.
 Logic errors — These are mathematical errors, casting errors, errors in proper command usage or errors in the structure of the script, which result in the script running improperly. Logic errors do not cause error alerts. The script may return unexpected results or may fail to execute at all.




Sunday, October 19, 2014

Lesson 5: Introduction to JavaScript



Hello everyone

This week we will be discussing introduction to JavaScript.
JavaScript is a a script language. A script language is a programming designed to enable computer users to write useful programs easily. Scripting languages include JavaScript, perl, PHP(PHP Hypertext preprocessor), TCl Tool Command Language) ColdFusion, VBScript and REXX. In this discussing we will focus on only JavaScript.
JavaScript is a scripting language that adds dynamic interactivity to web pages. JavaScript is considered a scripting language because it supports scripts, which are programs that interpret and automate task execution.
Javascript characteristics:
JavaScript is object based: This means that functions come from objects
JavaScript is event-driven: Scripts are driven by events(cursor clicking)
JavaScript is a platform-independent: Works in most browsers, but may render differently.
JavaScript enables quick development: Because JavaScript does not require time-consuming compilation, scripts can be developed quickly.
JavaScript is relatively easy to learn: JavaScript does not have all of the complex rules associated with Java or other full object-oriented languages. 
                                JavaScript vs. Other Languages
JavaScript has similarities to some other scripting languages. Today we will clarify the relationships between JavaScript and some other languages to which it is often compared.
JScript: Microsoft version of JavaScript. JavaScript and JScript have several difference. If you mistakenly use one instead of the other, there might be some  compatibility problems. 
VBScript: Both VBScript and JavaScript extend the capabilities of static Web pages.

Java: Advanced programming language. It is generally used to create stand-alone applications and a special type of mini-application called a Java applet. JavaScript has no relation to Java.
                        Objects, Properties, methods, and Variables
objects: parts of JavaScript. Each object has three groups of attributes. These attributes are
 properties,values, and methods 
Properties: various attributes of an object, such as height, color, font size, sentence length and so forth.
Values: the specific qualities of properties. E.g. the statement color="yellow" assigns a value to a property.
 Methods:the actions that an object can be made to perform, such as a calculation, an onscreen move or the writing of text into a window. Methods often describe the actions that an object performs with its properties. Here are some commonly used methods
alert(): creates a pop-up box with the specified message string, which the user can dismiss by clicking a button in the box.
 prompt(): creates a pop-up box with the specified message string and requests user input into a text field in the box.
 confirm(): creates a pop-up box with the specified message string and requests user confirmation (yes or no) by clicking the OK or Cancel button in the box.
document.write(): writes the specified message string in the page.
Variables: A named space of memory that holds a value. The value can change depending on a condition or information passed to the program, or by reassignment of a new value.
Naming variables: The first character of the variable must be a letter, the underscore ( _ ) character or the dollar sign ( $ ). No other initial characters are allowed. Subsequent characters can be letters, numbers and/or underscore characters.
Variables can hold numbers: numerical values, strings: text message, boolean: true or false, object: an object, null: hasn't been defined yet.
                             Expressions and Operators 
expression: Part of a statement this is evaluated as a value; it can use any combination of variables, operators, and other expressions.
operator: A symbol character used in programming expressions to instruct the program how to store or manipulate (operate on) a value.
operand: Data that is to be operated upon or manipulated in some manner.
                      JavaScript If /Else Statements
Conditional statements are used to perform different actions based on different conditions.
 The if() condition helps  you check conditions, while for() allows you to go through a set of data and do the same with each piece of data.
Last but not the least, to code JavaScript into web documents the code is placed between <script> tags( in either head or body)
You can also put JavaScript into web documents through inline scripting. Inline scripting is attributed to a specific element. I hope you learned something about JavaScript


Sources:
http://www.quirksmode.org/js/state.html  
http://www.w3schools.com/js/js_if_else.asp
http://education.certification-partners.com/CIW/

Saturday, October 18, 2014

tables, orderlists, unordered lists








Hi everyone
This week we have done a lot of codecademy, we learned how to make tables, order lists and unordered lists. We also learned how to use span and divs.
First let us talk about tables. Tables are used to store tabular data so it is easy to read. To make a table you must first set a table tag which is <table>, then add a table row tag which is <tr>. You don't really create columns in <table> instead, you tell each row how many cells to have, and that determines your number of columns.The second thing we learned was how to make order lists. An ordered list is simply a list that is numbered. to make an order list, you first begin with the opening tag <ol>. <ol> means order list. the next thing you do is to open a list item tag <li>. Everything you list must have a new <li>. always make sure that you close all your <li>s and <ol>s. the closing should alway look like this </li> and </ol>. The next thing we learned was how to make unordered lists. Unordered list are lists that are not very important. Unordered list some time go under ordered lists. To make an unordered list you must first open an unordered list tag <ul>, you then make <li> again always remember to close every tag you open. The next thing we learned was divs and spans.Divs allow you to section off a part of your webpage for individual styling. An example code for Divs will be
<div id="header">
<h1>school</h1>
<p>I love school </p>
</div>. CSS can now be used to give both lines of text a different background, border, font, etc. from the rest of the page using Divs

Spans: are used to target one specific word or group of words that might be a part of an overall paragraph. An example code of span is
<p>my school's name is<span style="color:blue;font-weight:bold">Fairmont Heights High School.</span> You could now use CSS to target that what you want to change. That all we did this week. I hope you learned something about making tables, order and unordered lists, spans and divs. For a more detailed information you can visit codecademy.






Tuesday, October 7, 2014

menus,buttons, and transparency



Hi viewers,


This week, we learned in web development class how to create menus and buttons, overly elements on top of one another. We also learned about using transparency and User Interfaces.
Menus: the menu item that matches the current page URL. CSS allows a web developer create menus by using CSS properties such as border-radius, box shadow, and hover
Buttons: The appearance property that allows an element look like a standard user interface element. CSS allow designer to create buttons to style borders with rounded corners around hyperlinked text
Overlay: A CSS technique used to place an HTML element on top of one another
In order to create an overlay, you must use z-index property to specify the stack order of an element. The Z-index property defines which element is placed in front of one another. Z-index uses positive or native values to determine how the elements are arranged. (Z-index positive value) (-Z_ index negative value.
Transparency is when CSS uses opacity to or RCBA to create transparency so that element closer to the bottom will be visible. The opacity property sets the opacity level for an element

I hope you learned something today

Thank you