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); }) 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo