How does jquery count as 'no library used'? EDIT: I get it guys - I complained without reading carefully, sorry...
A spreadsheet in fewer than 30 lines of JavaScript, no library used
31–40 of 274 posts
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#32Aside from losing input when tabbing out, works a treat in Opera. Can think of a couple of places that a fork of this might come in handy in my work this week. Clever, thanks for sharing
it does a parseFloat() on the input, so input that can't be coerced into a float gets turned into NaN and not displayed.
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#33I am impressed. Its a neat hack, it actually is a real spreadsheet in 30 lines of code, with references fully working (ie =A3+B4 gives expected output. As does =alert("foo") but then nothing is perfect). I think it says something about the browser as a platform - these thirty lines simply assume an enormous amount that excel and visicalc could not - visicalc had to write their own screen refresh routines. It is usefu…
with (DATA)
now that's just genius. I hate writing token parsing.
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#34This may sound like an inane comment, but trying working along Excel power users for the past two decades. Most people have no idea of the crazy, huge, complicated environment that is Excel.
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#35How does jquery count as 'no library used'? EDIT: I get it guys - I complained without reading carefully, sorry...
"$" replaced with "elm" to cause less confusion.
I'm afraid I suffered from commenting without reading properly. In my defence, seeing $ signs everywhere shuts down the careful part of my brain.
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#36How does jquery count as 'no library used'? EDIT: I get it guys - I complained without reading carefully, sorry...
Perhaps the use of the more modern querySelectorAll threw you?
https://developer.mozilla.org/en-US/docs/Web/API/Document.qu...
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#37Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#38Earlier quoted context omitted.
it does a parseFloat() on the input, so input that can't be coerced into a float gets turned into NaN and not displayed.
Makes sense, hadn't even looked that closely at the code before I commented - all 30 lines of it, ha. Shame on me.
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#39First thing I tried was "=alert()". While it worked, its tendency to block, recalculate, and persist with localStorage made it a bad idea, personally.
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#40My text disappears after I type it in and move on. And why do you call a table an "excel-like" app? Can it so =SUM(); can it do search and replace or the over 9000 other features of excel? No... it's a table, with a editor.
On the other, I imagine some PM is going to read this and expect their developers to get a google docs competitor out in a day!