Is there a good way to encode a JavaScript object as JSON?
I have a list of key value pairs...where the name is from a checkbox, and the value is either true or false based on whether the box is checked or not:
var values = {};
$('#checks :checkbox').each(function() { values[this.name]=this.checked; });
I want to pass these values into a JSON object so store into a cookie to render a table (Columns will be added according to what the user checks off).
Does anyone know a solution?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…