Web Session Notes In Memory | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Web Session Notes In Memory

I’ve been trying to figure out the simplest way to do session notes in a web app in memory. It should allow users to create shorthand notes while viewing something, and storage isn’t really necessary. In the final implementation I will have a ‘save’ button to store it as an object under the user somewhere, but this is the basic code: https://code.sololearn.com/WFDWGSQ37DbV/?ref=app. Anyone have a better solution?

27th Dec 2017, 9:52 PM
Max Tremaine
Max Tremaine - avatar
1 Answer
+ 5
It works for me / looks fine :), just a few usability notes... 7: Forms have an ancient behavior where they "go check a validator" before networking off to a server. If I press enter on my keyboard, the form accidentally submits: <form onsubmit="alert('whoops')"> But if the "validator javascript" returns false, the submit is cancelled, so... <form onsubmit="return false"> 37: App users may not be able to use ES6. Unfortunately, the arrow keyword doesn't have a polyfill so it actually terminates the entire script block: post.onclick = () => { The only reliably beginner-friendly thing I know of is to skip the arrows (or mark it as ES6 / a browser-only code): post.onclick = function() { 54: Focus recycling. If onclick you want the field to be ready for immediate typing again: message.focus();
27th Dec 2017, 11:32 PM
Kirk Schafer
Kirk Schafer - avatar