Something else doesn't fit in another section of your code.
Take a look at this fiddle I created.
It reads and writes the value accurately. Exactly the same code:
https://jsfiddle.net/nxka5h7y/2/
<head>
<script src = "https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script>
window.localStorage.setItem('createTicket', '{"a":"1"}');
$(document).ready(function() {
if (window.localStorage.getItem('createTicket')) {
var createTicketInfo = JSON.parse(window.localStorage.getItem('createTicket'));
console.log(createTicketInfo);
} else { console.log("none"); }
});
</script>
</head>
<body>
<script>
</body>
The only thing I added was actually setting the createTicket element to localStorage to make sure the if if statement inside the document / ready gets through.
My semi-logical guess is that the JSON stored in createTicket is malformed based on how it was set (which is not shown in your example.) I really don't think that's the problem. But, actually, your example gives exact results in jFiddle. Look elsewhere in your code. For example, the part where you actually set createTicket. Or that your jQuery is really included or something silly.
InfiniteStack
source
to share