MCQ Single Best Answer Easy

QWhich of the following functions is used as a result of the Cookie value lacking semicolons, commas, or whitespace?

ID: #5210 Javascript DOM & Event Handling MCQ 149 views
Question Info
#5210Q ID
EasyDifficulty
Javascript DOM & Event Handling MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A encodeURIComponent()
  • B encodeURI()
  • C encodeComponent()
  • D encode()
Correct Answer: Option A

Explanation

Semicolons, commas, and whitespace are not permitted in cookie values.
As a result, you may want to encode the value before storing it in the cookie using the core JavaScript global function encodeURIComponent().

Share This Question

Challenge a friend or share with your study group.