Comments (5)
You need to pass an array of nodes. I can't help further without seeing the input or a minimal test case.
from himalaya.
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.
I need a full example, I don't know what response.Table[0].todoData
is.
from himalaya.
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.
I've fixed my issue but replacing every JSON incompatible characters.
from himalaya.
Related Issues (20)
- can it be used in react native ? HOT 1
- Maximum call stack size exceeded on a large string, increasing the process' stack size works tho. HOT 3
- Output pane not scrollable HOT 2
- Will it add support for custom void tags HOT 6
- Get text from elements
- Bad HTML to bad JSON issue (some notes to save you time)
- Recursively find/filter elements in the "dom" HOT 1
- Why is the position parameter in the arrayIncludes method using | instead of || ? HOT 3
- Incorrect JSON returned when parsing a specific site HOT 1
- Can't pass SVGs in HTML HOT 1
- img tag isn't self closing HOT 1
- Code in script block may break output HOT 3
- [Q/A] really stable ? HOT 1
- what's the difference between himalaya and DOMParser? HOT 1
- NY Times HTML breaks it
- Some type definitions [Typescript] HOT 1
- can't handle parse vue sfc content correctly
- it will parsing error when element name is "col" HOT 1
- An in-range update of browserify is breaking the build 🚨 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from himalaya.