Jquery : Automatic type conversion during parse JSON

后端 未结 4 770
猫巷女王i
猫巷女王i 2021-01-14 22:58


Is there a way to specify type while parsing Json, so that the conversion happens automatically.

So I have the jsonData, and the x and y values needs to be n

4条回答
  •  终归单人心
    2021-01-14 23:36

    The only way is to loop through you JSON data and convert the strings you find into numbers using parseInt("2");.

提交回复
热议问题