Thursday, July 31, 2014

Inner HTML

-First of all: you should know the relationship between  JavaScript and HTML where JavaScript is a way to make the events in the HTML page turn it to actions. get elements from HTML page you can see this article: JavaScript and HTML Now,after we get our element from the HTML page we want to use it and change it for example we'll...

Javascript Errors exceptions and handling

-Error: There might be alot of errors in your code which you cant see or know what is it maybe you'll put a double into integer variable and this is an error maybe the browser console"compiler" wont see this an error but it might cause a problem for your project -Try statement: this statements is used to check the code from errors but...

Break and continue statements

-For and while loops: we talked in previous lesson about for and while loops and we now know what is it used for and you can check it again here For and while loops sometimes we want to make a condtion if it happens then we dont want our for or while loop to continue just break that loop and execute the code out of that loop -Break: its...

Tuesday, July 29, 2014

For and While loops

-Array elements access: in our article about arrays here Arrays we talked that its a special type of object and its a variable that can store more than one value so the best way is to write something that can call a code more than one time and for different values. -For loops: If you want to execute the same code over and over...

Sunday, July 27, 2014

Comparison and Logical Operations

-Comparison operations: they are used to compare between two values in the logical statements just like "if statements" this operators return a boolean value True or False lets assume the we have a value x=10 lets see this table : Operator Description Example  Returned value == compare the equality of value to x=1- 1)x==10 2)x==8 1)True 2)False === compare...

Saturday, July 26, 2014

Arrays

-The difference between objects and arrays ? objects are variables with multiply properties and methods  Arrays are also special kind of objects because it has its own methods and properties  arrays are variables that can store more than one value in one variable so there can be an array of objects and the arrays looks like this:   ...

Math Object

-Remember: Objects are like variables but they have properties and methods and we know how to use them and if you didnt read that article Go here: Objects in Javascipts -Math object: its a speical object with has a few methods about Mathematical things these methods and functions are already been written by the Javascript founders...

Friday, July 25, 2014

Variables lifetime

- You should know that after declaring the variable it wont stay in the Ram forever it'll be delete it after you close your program or webpage  and it wont be always available wherever we want in our webpage to know more about this let see this article: -Local variables: when you declare a varaible into a function then it'll be local that...

Javascript Functions

-Why functions? its a block of code which execute when something call it  -What the benfits of useing functions? if we want to find the max between 10 numbers we should make the comparison 10 times by writing  instead of writing a code more than one time we can write a function and then call it any time we want so for...

Objects in javascript

lets imagine we have a student what does this student have First name Last name address tel ......etc all this each student have them so if you want to make a web page for school which has 100 students if we want to store the students varaibles we'll need for example 5 varaibles for each students so in total we'll have for example 500...

Wednesday, July 23, 2014

Javascript and HTML

we see before how to call function in javascript using the HTML elements by the events handlers but how can we use the HTML elements in our javascript code for example if you want to make a simple example of validation for text box the text box shouldnt have a zero value but how can we get the value in our text box  getElementById: this...

Actions and Events 2

onmouemove: when the pointer of the mouse move this will occur  onmouseout: this will happen when the mouse pointer is out of the element  onmouseup:when a user releases a mouse button over an element onunload: this is just like the onload function but its opposite because this will occur when the page didnt load for some reasons  onerror: if something was wrong with your code this function will be called or if...

Actions and Events

When we click on the button we need something to happen and some code to execute we have some special functions we can use them when a button clicked or a key pressed lets see some of them now  OnClick function: this function can be used when you click on your mouse on Button,text,link.....kinda all HTML elements lets see this example: Onkeypress:...

variables Arithmetic operations

as we said before variables are containers of values and data so we can use this data and store them and do some operations to them just like the arithmetic operations Add: the value of z is the sum of x and y Subtract: Note if z was integer this will be Error because it can store negative value so be Aware Multiply: Division: Note...

If statements

If statements is very important in our job how? you can use this when we want to make a speical action to happen only when our condition of that thing happen for example you want to delete what in  the text box only when its empty for this we use if(statements){............}  you should know that everything you write our of these...

Variables Data Type

we know what are variables but we use the "var" to initialize a variable without making it for specific type since we know we have numbers,text,alphabet and Boolean   the "var" is like a general container which can store anything we want but we cant store text in number variable for sure lets see the variables data type : Integers:...

Javascript

we know now what does javascript means and how to use it now we should know some of programming things to get used about the javascript variables : its container for data and informations just like text ,numbers,and maybe true or values data how to use variables and how to save them and store them in the computer memory but you should know...