Export to GitHub

jquery-jstore - issue #42

missing : after property id


Posted on Jul 14, 2010 by Swift Hippo

What steps will reproduce the problem? 1. Run the scripts

What is the expected output? What do you see instead?

I get the following error

missing : after property id http://localhost/fav/jstore2/jStore.Flash.html Line 0 var __flash_temp = ({uki-favorites:"as...tp://www.google.com"}); __flash_temp;\n

What version of the product are you using? On what operating system? Latest version 2 from trunk.

Please provide any additional information below.

Comment #1

Posted on Jul 14, 2010 by Swift Hippo

I have found the cause. The storage engine does not like - in a variable name. So jQuery.jStore.get('ukifavorites')works jQuery.jStore.get('uki-favorites') does not.

Comment #2

Posted on Nov 1, 2010 by Quick Bird

This is actually a parse error, I think. That issue isn't with jStore, it's with your storage code. {foo-bar: ...} is not a valid object declaration. If the object key contains any special characters, like -, you must wrap it in a string. Try:

{"uki-favorites": ...} and it should work.

Status: New

Labels:
Type-Defect Priority-Medium