1.2. Communication and Internet technologies
A subsection of Computer Science, 9608, through 1. Theory Fundamentals
Listing 10 of 44 questions
The design of a web-based application can require the use of client-side scripting. Describe what is meant by client-side scripting. A user requests a web page by keying the Uniform Resource Locator (URL) into the address bar of their web browser. The requested page contains a client-side script. Describe the sequence of steps leading to the display of the web page on the computer screen. A web page used for data capture consists of: • two text boxes for the entry of: • a product code • the number of items to be purchased. • a button which is clicked when the user wants to submit this order. Study the following web page. Untitled Document function myButton_onmousedown() { var Message1 = "ERROR – Order refused"; var Message2 = "Product code OK"; var x = document.forms["form1"]["txtProductCode"].value; if (x == "") { alert(Message1) } else { alert(Message2) } } Product code: Number: Submit order: The developer has used three variables in the JavaScript code. State the identifiers used. The button has an event whose identifier is onMouseDown. When the submit button is clicked, some code is executed. State the line numbers that contain this code. From line to line The JavaScript code uses a selection statement. State the line number that contains the condition. Line number: Describe the purpose of the validation check that the code performs. Name and describe two other types of validation check that could be appropriate for this data capture form. Validation check: Description Validation check: Description
9608_s17_qp_11
THEORY
2017
Paper 1, Variant 1
The design of a web-based application can require the use of client-side scripting. Describe what is meant by client-side scripting. A user requests a web page by keying the Uniform Resource Locator (URL) into the address bar of their web browser. The requested page contains a client-side script. Describe the sequence of steps leading to the display of the web page on the computer screen. A web page used for data capture consists of: • two text boxes for the entry of: • a product code • the number of items to be purchased. • a button which is clicked when the user wants to submit this order. Study the following web page. Untitled Document function myButton_onmousedown() { var Message1 = "ERROR – Order refused"; var Message2 = "Product code OK"; var x = document.forms["form1"]["txtProductCode"].value; if (x == "") { alert(Message1) } else { alert(Message2) } } Product code: Number: Submit order: The developer has used three variables in the JavaScript code. State the identifiers used. The button has an event whose identifier is onMouseDown. When the submit button is clicked, some code is executed. State the line numbers that contain this code. From line to line The JavaScript code uses a selection statement. State the line number that contains the condition. Line number: Describe the purpose of the validation check that the code performs. Name and describe two other types of validation check that could be appropriate for this data capture form. Validation check: Description Validation check: Description
9608_s17_qp_13
THEORY
2017
Paper 1, Variant 3
A web page includes HTML and JavaScript code. 04 Calculate area of a triangle: 06 Base 07 Height 08 Calculate 12 function area() { 13 var base = document.forms["Triangle"]["B"].value; 14 var height = document.forms["Triangle"]["H"].value; 15 if (base == "" || height == "") { 16 alert("Both values must be entered"); 17 return false; 18 } 19 else { 20 area = 0.5 * height * base; 21 alert("The area is: " + area); 22 } 23 } Give the three identifiers used in the JavaScript code. State the purpose of the code on line 08. The page is loaded and the values 2 and 8 are entered. State the output when the calculate button is clicked. State the meaning of the || operator in line 15 of the code. Data validation has been used in line 15 of the JavaScript code. Identify the type of data validation used in line 15. Identify two other data validation checks that could be used. Question 5 continues on the next page. Cambridge International Holidays allows customers to make holiday bookings on its website. Bochen visits the Cambridge International Holidays website to book a holiday. The sequence (1 to 8) below describes the steps that take place when he submits a booking. Four of the statements A, B, C, D, E and F are used to complete the sequence. A Any errors found at the server side are flagged, and step 1 is repeated. B HTML code is used on the client’s web browser to validate the form data. C PHP code is executed to generate a confirmation (HTML) web page that is returned to the client’s web browser. D The form data is transmitted to Cambridge International Holidays’ web server. E JavaScript code is executed to generate a confirmation (HTML) web page that is returned to the client’s web browser. F JavaScript code is executed on the client’s web browser to validate the form data. Write one of the letters (A, B, C, D, E or F) in the appropriate row to complete the sequence. Bochen completes the online booking and clicks ‘Submit’. Any errors found are flagged, and step 1 is repeated. PHP code is executed to perform extra data validation checks on the form data. The booking details are added to the database.
9608_s21_qp_12
THEORY
2021
Paper 1, Variant 2
Questions Discovered
44