convert CSV lines into Javascript objects

后端 未结 4 2081
感情败类
感情败类 2020-12-16 17:51

I have a simple csv file

people.csv:

fname, lname, uid, phone, address
John, Doe, 1, 444-555-6666, 34 dead rd
Jane, Doe, 2, 555-444-7777, 24 dead rd         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-16 18:58

    You could try using MVC Razor,

    
    

    The Json.Encode will serialize the initialized object to JSON format. Then the Html.Raw will prevent it from encoding the quotes to ".

    Here the entire example

提交回复
热议问题