Web Programming
Codings Web Page
The objective of this exercise is to provide a web page that allows a text to be encoded with various codings.
Tasks
-
In the script codings.js rewrite the
Coding constructor function as class with the methods encodeChar and encode, and export the coding objects as an ES6 module.
-
Write a web page
codings.html that imports a JavaScript module main.js and contains an input field, a selection list of codings, and a button.
-
Implement the JavaScript module
main.js which imports the coding objects and uses them to encode the text of the input field when the button is clicked.
-
(Optional) If the Morse coding is selected, display an additional button for playing the generated Morse code using the script morse.js.
Solution