Doesn't work with decimals.
You're right. I'm re-installing Excel and giving this a negative review on the app store!
A 220b spreadsheet app in HTML/JS
31–40 of 105 posts
Re: A 220b spreadsheet app in HTML/JS
#32Re: A 220b spreadsheet app in HTML/JS
#33=1;alert("Hi")
yes hack yourself. bravo :) I guess you would have to sanitize when you save and/or load the spreadsheet
Sanitizing? No chance. Either you have a dedicated expression parser, or you run it directly throgh eval. There is no reliable middle ground. Decades of security failures of so-called "sanitizers" show this pretty clearly.
(Even if you manage to create a perfect sanitizer today, wait a few months, new features are added to the browser, and new loopholes will appear out of nothing.)
But that may be missing the point, because if you want more code quality, more safety and more features, of course you need more code. This demo illustrates the other way around: If you allow for dirty hacks, you can get away with a surprisingly small amount of code.
Re: A 220b spreadsheet app in HTML/JS
#34Re: A 220b spreadsheet app in HTML/JS
#35Thanks!
Re: A 220b spreadsheet app in HTML/JS
#36Re: A 220b spreadsheet app in HTML/JS
#37Initially, I wa puzzled by how the grid could be showing placeholders (the grey "A1", "A2", etc.) when there's no placeholder attribute defined in the source code. Then I discovered that the code running in the demo is not actually the showcased 220-byte source code at all. The code is still impressively small, but you should fix this — it's misleading as is.
I think that's probably just because it's been revised and the placeholders were added after. To be fair, it only adds an extra 18 chars, taking it up to 238-byte in size. EDIT Here it is once you add the extra property: (o=b=>{for(j in a)for(i in a)y=a[i]+-~j,b?document.write([[" "][i]]+" "):eval(y+(".value"+o[y]).replace(/[A-Z]\d/g," +$&.value"))})(a="ABCD")
Re: A 220b spreadsheet app in HTML/JS
#38Well done!
Re: A 220b spreadsheet app in HTML/JS
#39Initially, I wa puzzled by how the grid could be showing placeholders (the grey "A1", "A2", etc.) when there's no placeholder attribute defined in the source code. Then I discovered that the code running in the demo is not actually the showcased 220-byte source code at all. The code is still impressively small, but you should fix this — it's misleading as is.
I think that's probably just because it's been revised and the placeholders were added after. To be fair, it only adds an extra 18 chars, taking it up to 238-byte in size. EDIT Here it is once you add the extra property: (o=b=>{for(j in a)for(i in a)y=a[i]+-~j,b?document.write([[" "][i]]+" "):eval(y+(".value"+o[y]).replace(/[A-Z]\d/g," +$&.value"))})(a="ABCD")
Re: A 220b spreadsheet app in HTML/JS
#40Didn't know minimizers were this good today ;) Well done!