Vietnam

    Nodejs.vn

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Groups
    • Search

    Cách render HTML từ JSON

    Hỏi Đáp
    0
    4
    931
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Khôi Nguyên
      Khôi Nguyên last edited by

      Mình muốn render ra file html từ JSON DATA web api . Cảm ơn mọi người .

      1 Reply Last reply Reply Quote 0
      • Nam Trinhviet
        Nam Trinhviet last edited by

        cấu trúc data trong JSON của bạn là gì? Cho thêm thông tin hoặc 1 data mẫu đi

        1 Reply Last reply Reply Quote 0
        • tuanquynet
          tuanquynet last edited by

          Cấu trúc data của JSON rất khác nhau. Bạn nên có một định dạng nhất định. Thông thường bạn phải làm một file html template nhất định rồi dùng template engine để fill data vào template đó. vdu: handlerbars, jquery, ES6 template,...Với EcmaScript 6+ bạn có thể dùng template literal của ES6

          papa elf

          1 Reply Last reply Reply Quote 0
          • Nguyễn Minh
            Nguyễn Minh last edited by

            Bạn tham khảo http://handlebarsjs.com/

            1 Reply Last reply Reply Quote 0
            • First post
              Last post