Your SlideShare is downloading. ×
Les 2 javascript w2
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Les 2 javascript w2

377
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
377
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Javascript 2
    IF-Else / Switch / PopUp / Functions
    Mediatechnologie Blok 8
  • 2. IF - Else
    • if statement- use this statement to execute some code only if a specified condition is true
    • 3. if...else statement- use this statement to execute some code if the condition is true and another code if the condition is false
    • 4. if...else if....else statement- use this statement to select one of many blocks of code to be executed
    if (time < 12)
    {
    document.write("Goede Morgen");
    }
    else
    {
    document.write("Goede Middag");
    }
  • 5. IF - Else
  • 6. IF - Else
  • 7. Switch
    switch(n){case 1:  execute code block 1  break;case 2:  execute code block 2  break;default:  code to be executed if n is different from case 1 and 2}
  • 8. Switch
  • 9. Pop-Up
    Alert
    alert(“tekst");
  • 10. Pop-Up
    Confirm
  • 11. Pop-Up
    Prompt
    prompt(“text","defaultvalue");
  • 12. Functions
    functionfunctionname(var1,var2,...,varX){some code}
    The parameters var1, var2, etc. are variables or values passed into the function. The { and the } defines the start and end of the function.
    Note: A function with no parameters must include the parentheses () after the function name.
    Note: Do not forget about the importance of capitals in JavaScript! The word function must be written in lowercase letters, otherwise a JavaScript error occurs! Also note that you must call a function with the exact same capitals as in the function name.
  • 13. Functions
    Return
  • 14. Functions
    Browserdetectie
  • 15. Functions
    Browserdetectie 2
  • 16. Opdracht !
    Experimenteren met de code !