I am using a sample script to populate a table in my website. Basically I want to copy save a persons answers persistently so if they refresh the page, their choices are still there. I have the function adding items to the table, the clear all button works, the main problem is the delete button will not work. I get the error; "can't find variable" in console, even though I can see the variable stored by checking console.log(window.localStorage);

Well, console.log(window.localStorage) will indicate that window.localstorage is an object. If you put a breakpoint in deleteItem, try outputting localStorage.getItem('SOMEKEY') and see if you get a value.
–
Mister EpicFeb 4 '14 at 16:56

When I put that in I get "test" back test being the variable and key i inserted into table, and as well the table is populated with test and test in the key value area, it just can't seem to find it to delete it. Am I missing something in the on click call
–
user1881482Feb 4 '14 at 16:59

Just as an aside, you might consider using createElement() instead of insertCell. According to this test framework, insertCell is a LOT slower, which means a potential bottleneck for you in the future if you have really extensive tables... jsperf.com/insertcell-vs-create-new-td
–
Jason M. BatchelorFeb 4 '14 at 17:14

(Ok, the /only/ exception is that IE is faster with insertCell than createElement... nevertheless, for usable browsers, there is a noticeable performance difference...)
–
Jason M. BatchelorFeb 4 '14 at 17:16

Thanks, thought it had to be something simple. It was look for deleteItem(test); and it should have been looking for deleteItem('test');
–
user1881482Feb 4 '14 at 17:03

Sometimes the simplest things are the ones that we miss! Glad I could help :)
–
ArcherFeb 4 '14 at 17:04

I was using this as proof of concept to save data. Is there a way to save a table row and reproduce that in a second table. Essentially i have a table that has 3 columns in it and I can only pass two values to the new table. So column one is a picture, column two a lat and long, and column three the address. Right now I can pass the lat/long and address, I need to add the image
–
user1881482Feb 4 '14 at 17:52

You could just get the whole row and save that in localStorage... $("#tableID tr")[0].outerHTML (for example)
–
ArcherFeb 5 '14 at 9:29