Wednesday, July 23, 2014

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 : this wont be Error if z where Integer but it wont get only the Integer part what does that mean the output of 1/5 is 0.2 this means Z will be 0 only and if the output was 2.2 the value will be 2 only so be AWARE

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 braces of the if condition it'll happen no matter if the condition occurred or not 
  • lets see a few example and show the output of it:


the alert wont happen unless the value of x is zero 
  • what if we wont do to an action if our condition didnt valid i mean if x wasn't zero we
     should show something we can easly write:

         but this alert(1); will happen even if the condition happened or not so how to stop this from happening           unless if the condition didnt happen this can happen if we use else statements this will happen only and           only if the first if didnt happen and we cant use it without previous if lets see this
 

alert(1) wont happen unless x is not 0








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 :

  1. Integers: are then numbers without negative value its from zero to the last number in the world but its all positive and it'll be an programming Error which might stop the page from doing some stuff because of that error how to declare this kind of variables :
  2. Strings: strings used to store and save text or an array of letters or just one letter as you wish 

     3.  Boolean: it has one two values "true" or "false" its just like the "on" and "off" in the electronic stuff        we usually use this in the conditions we want to happen before the action should start 
         
    these are the most common used data type of variables there's float for number and its between -36,000 and +36,000 and double for numbers too but has more numbers than float 

    NOTE: if you dont want to get stuck with all these types just use the General form of it "var" but you must know all this 

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 that its temporary storage that means when we close our webpage the variable will delete the value inside it and we can store it in an advanced way later and to 
          lets see this example :
                      
\

now x have a value of 1

         here's another example : 
         Note :if we want to store a text in a variable we should use a "Text" 

        

i hope you like it 

JavaScript introduction

Hey.....

today we'll talk about a very important thing in web developing which is javascript its not like the "java" programming language what is it then?
  • the usage of javascript is to transfer the events that happen in the HTML page to actions so for example in our Sign up Form after we fill the information what will happen if we click the submit button for now nothing will happen because that event there isnt a handling for it a handler which change it into action
  • javascript is easy and simple it has some special features and the most important thing in java is function 
  • Function: is a specific instructions that happen together and we call that function to start and begin .
  • javascript code can be written in the <head> tag or in an external file and then include it into our HTML page just like the external CSS file we did before lets see this simple example :

  • ONE IMPORTANT THING: after we write our function the thing we want to happen we should know when and how to call it thats why there's a action handle for buttons there's onclick function this is another function that calls our function when we click on the button .

 

and first we'll see the button when we open this code in our browser but nothing will happen until we click on it: 
and when we click our button this will show :
Note: this might change from a browser to browser so this is in Google ghrome but it wont be the same in firefox or other browsers ..



HTML 5 ,New Tags

Hi,we'll talk about a few new tags and elements of HTML 5:
  • this tag is used to make a highlight on text and you can change its color but the default color is yellow lets see this example :
  • <mark> this tag is used to make a highlighted text its so easy to use and its default color is yellow:
     

and it'll look like this: 
  • <progress> this tag is good one if you want to show the progress of special thing you doing for example in our Sign up form if it has more than one step we can show this to make a good style about how much we did to finish the steps : 




and it'll be :
  • <details> if you make a big article and you want to make like a summary of it you can use this tag it'll be like a additional information for your article example:




and it'll be like this :

  • as you can see the HTML 5 has made a new tags which make it easy and simple to use

Monday, July 21, 2014

HTML 5

Introduction

Hi guys for about 26 articles we've talked about HTML but we didnt say what version we were using it was HTML 4 it was good it has some special features more than the previous versions but it came in 1999 and the internet changed a lot since then.

  • HTML 5 designed to replace HTML 4 which has been using for a long time what make HTML 5 so special :
  1. it was designed to make a lot of things without using additional plugins or writing a lot of code for example the audio or video article we talked about they used the tag <embed> to show the non-HTML content but now its simply to use the <video> or <audio> tags  and it can do the same thing but in a very simple and easy way
  2. its a good platform for animation and graphics .
  3. good way to make a very complicated web applications
  4. 2D Drawings
  5. Error handling should is easier
  6. and sure its based on HTML 4 so no new coding syntax .
  • this was an introduction and we'll start to learn more about its in the next article hope you'll like it