Past-paper question · 2021 May-June · Paper 31 · Q10

Question 10 2021 · May-June · Paper 31 · 6 marks

Original past-paper question for 10
Reveal official mark-scheme answer Official mark-scheme answer for 10

Official answer for Question 10

✓
Six from:

Question 6

✓
Error event is triggered whenever an exception occurs in JavaScript code
✓
The onerror() function only captures the error
✓
The onerror() function stores the details of/data of error for later examination
✓
Function passes error event details to alert box for display to user
✓
Variables are used to pass parameters of the error to the program for further
✓
processing
✓
Msg is the message that the browser displays (to Jasmine)
✓
URL is the file name/path of code in which the error has occurred (so Jasmine
✓
knows which file to look in)
✓
Line is the line which contains the error (so Jasmine knows where to look in
✓
code).
✓
Question
✓
Answer
✓
Marks

Mark scheme 9626_s21_ms_31.pdf →

Show text version of question

Question 10

Jasmine is using JavaScript on her web pages to provide interactivity. She has encountered some runtime errors during the testing of her JavaScript code.

She has written some code including window.onerror = function (msg, url, line)

The onerror() event handler will trap errors.

Describe how this can help Jasmine locate the mistakes in the rest of her code.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

....................................................................................................................................................

[6]

Question 12

Topic relevance

Why this question appears here

98% assigned-topic match · Programming for the web

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9626_s21_qp_31.pdf

Keep practising this topic