javascript - JSON.stringify() <input> values as numbers? -
i using json.stringify()
on html <input>
s send through websocket so:
json.stringify({ numbervalue: $('#numbervalue').val() })
but encodes $('#numbervalue').val()
string
.
how can encoded number
?
convert integer first.
json.stringify({ numbervalue: parseint($('#numbervalue').val(), 10); })