Coder Social home page Coder Social logo

tree.map is not a function about himalaya HOT 5 CLOSED

Isetnt2 avatar Isetnt2 commented on September 6, 2024
tree.map is not a function

from himalaya.

Comments (5)

andrejewski avatar andrejewski commented on September 6, 2024

You need to pass an array of nodes. I can't help further without seeing the input or a minimal test case.

from himalaya.

Isetnt2 avatar Isetnt2 commented on September 6, 2024

This is the code I'm trying to execute
json2html(response.Table[0].todoData); I do console.log(response.Table[0].todoData) before and it returns the array I parsed with
html2json(document.querySelector('.list-group').innerHTML)
When I copy the console.log() and pass it in the browser console it returns correctly but not when calling it in the JS

from himalaya.

andrejewski avatar andrejewski commented on September 6, 2024

I need a full example, I don't know what response.Table[0].todoData is.

from himalaya.

Isetnt2 avatar Isetnt2 commented on September 6, 2024

It's a http get request that returns the value that I pushed to the server and ls the parsed value of

html2json()

This is the currently parsed value on the server

{"node":"root","child":[{"node":"text","text":"
    
 "},{"node":"element","tag":"div","attr":{"class":["window","mac","list-group-item"]},"child":[{"node":"element","tag":"div","attr":{"class":"title-bar","id":"light"},"child":[{"node":"text","text":"  "},{"node":"element","tag":"div","attr":{"class":"close","id":"listItem"}},{"node":"element","tag":"div","attr":{"class":"minimize"}},{"node":"element","tag":"div","attr":{"class":"zoom"}}]},{"node":"element","tag":"div","attr":{"class":"page"},"child":[{"node":"element","tag":"p","attr":{"class":"message","id":"light"},"child":[{"node":"text","text":"123123"}]}]}]},{"node":"element","tag":"div","attr":{"class":["window","mac","list-group-item"]},"child":[{"node":"element","tag":"div","attr":{"class":"title-bar","id":"light"},"child":[{"node":"text","text":"  "},{"node":"element","tag":"div","attr":{"class":"close","id":"listItem"}},{"node":"element","tag":"div","attr":{"class":"minimize"}},{"node":"element","tag":"div","attr":{"class":"zoom"}}]},{"node":"element","tag":"div","attr":{"class":"page"},"child":[{"node":"element","tag":"p","attr":{"class":"message","id":"light"},"child":[{"node":"text","text":"123"}]}]}]},{"node":"element","tag":"div","attr":{"class":["window","mac","list-group-item"]},"child":[{"node":"element","tag":"div","attr":{"class":"title-bar","id":"light"},"child":[{"node":"text","text":"  "},{"node":"element","tag":"div","attr":{"class":"close","id":"listItem"}},{"node":"element","tag":"div","attr":{"class":"minimize"}},{"node":"element","tag":"div","attr":{"class":"zoom"}}]},{"node":"element","tag":"div","attr":{"class":"page"},"child":[{"node":"element","tag":"p","attr":{"class":"message","id":"light"},"child":[{"node":"text","text":"123"}]}]}]},{"node":"element","tag":"div","attr":{"class":["window","mac","list-group-item"]},"child":[{"node":"element","tag":"div","attr":{"class":"title-bar","id":"light"},"child":[{"node":"text","text":"  "},{"node":"element","tag":"div","attr":{"class":"close","id":"listItem"}},{"node":"element","tag":"div","attr":{"class":"minimize"}},{"node":"element","tag":"div","attr":{"class":"zoom"}}]},{"node":"element","tag":"div","attr":{"class":"page"},"child":[{"node":"element","tag":"p","attr":{"class":"message","id":"light"},"child":[{"node":"text","text":"123"}]}]}]}]}

from himalaya.

Isetnt2 avatar Isetnt2 commented on September 6, 2024

I've fixed my issue but replacing every JSON incompatible characters.

from himalaya.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.