Sunday, August 3, 2014

Popup alerts

-Alerts: Most of the times while you are using the internet and moving between the website some of them shows up a Popup boxes to tell you something maybe an error in the signup registration or a wrong value of any field  Its very good to use them but remember it might be annoying for some users so i prefer you just use it to get your...

Browsers Object Model (BOM) Location

-Window and screen objects: in the last article we talked about the these two objects where each of them has its unique methods and properties you can check out the previous article to get more information JavaScript Browsers Object Model (BOM) Screen and Window -Location object: its one of the objects of our browsers just the Window...

Saturday, August 2, 2014

JavaScript Browsers Object Model (BOM) Screen and Window

-Objects: we know that Objects are special type of variables that have a special methods and properties and you can check out our article about it Objects in JavaScript  -BOM: Browsers objects model it makes the JavaScript code connect with the browser and talk with it since most of the browsers have been implemented almost the...

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:...