☰ خطة العام · تكنولوجيا المعلومات والاتصالات (بالإنجليزية)

Code, changing pages and fixing problems

الأسبوع 21 · المحور الثالث، الدرس ٦ «البرمجة والمشكلات الرقمية وكيفية حلّها»: لغات البرمجة والمحتوى الثابت والمتغير وحلول المشكلات · 3 دروس
2

Fixed page or changing page?

ICT P6 Term 2, Theme 3: pp. 30–33
GoalCompare HTML and JavaScript and decide which pages and apps need content that changes.
New words
Venn diagram · a drawing with overlapping circles that shows what is different and what is the sameuser · the person who uses a page or an appinteraction · what a user does to a page, such as pressing a buttonshopping basket · a list that grows as a shopper adds things
Explanation

Which language should you choose? It depends on the job. HTML is popular for smaller websites and is easier to start with. It builds pages that are set and fixed. A language such as JavaScript is better when the page must change because of the user, and it can make the page feel personal. What do they share? Both are languages for making websites. A Venn diagram shows this well: put what only HTML does in one circle, what only JavaScript does in the other, and what both do in the middle. To decide if a page needs content that changes, ask: does it have to react to something the user does? A chat, a game score and a shopping basket all do. A poster of school rules does not. Many pages mix both: the title is fixed, but the number of items in a basket changes.

HTMLJavaScripteasier to startsmaller sitespages that changewith the userlanguages forbuilding websites
Worked examples
chatgameshopping
Three pages that must change as users act: a chat page, because new messages arrive; a game page, because the score moves; a shopping page, because the basket grows with each item.
Karim fills a basket. He adds 2 books and the page says ‘Items: 2’. He adds a pencil and it says ‘Items: 3’. The number changes after each action, which is dynamic content.
Part of the pageStatic or dynamic?
title: Today’s weatherstatic
the temperaturedynamic
a note: ‘Take care’static
A weather page for a pretend town. The words ‘Today’s weather’ are static. The temperature must be updated all day, so it needs a language that can change the page.
Class activity

Venn and choose. Draw a Venn diagram with HTML and JavaScript and put these in the right place: ‘easier to start’, ‘reacts to the user’, ‘used to build websites’, ‘best for a small fixed page’. Then imagine a page that shows boat trips on the Nile: which parts stay fixed and which parts must change when a visitor picks a day? Say which language fits each part.

Practice
1
What do HTML and JavaScript have in common?
2
Which one is better for content that changes with the user?
3
Give three examples of pages or apps that must change as users act.
4
Is a poster of school rules static or dynamic?