How to store dictionary in input field (HTML)?

u_bin_called

New Member
I have a big dictionary consisting of multiple fields. var deal = {'foo':'moo','foo1':'moo1','foo2':'moo2','foo3':'moo3','foo4':'moo4','foo5':'moo5'}I want to store this as a hidden input field.i.e. \[code\]`<div class="deal"><input type="hidden" value=http://stackoverflow.com/questions/13758726/deal />//unique for this div</div><div class="deal"><input type="hidden" value=http://stackoverflow.com/questions/13758726/deal />//unique for this div</div><div class="deal"><input type="hidden" value=http://stackoverflow.com/questions/13758726/deal />//unique for this div</div>\[/code\]Retrieving \[code\] $(".deal").on('click',function(){ var deal= $(this).find('input').val();});\[/code\]And retrieve this using jQuery. While retrieving this by jQuery I am facing issues i.e. I think the entire data is not being stored.(Half the dictionary is being truncated.) Should I instead just query my database and get this? or is there a way to store the dictionary as the input field value ?If the question is not clear please comment. I will make necessary additions.
 
Back
Top