Questions tagged [json2html]

json2html is a javascript HTML templating library used to transform JSON objects into HTML using a another user specified JSON transform.

json2html
Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

How to add the json2html library to a typescript project?

I am currently using webpack 5 * and installing this package with the team npm install node-json2html as per instruction на https://www.npmjs.com/package/node-json2html Errors occur during project ...
1 vote
0 answers
66 views

using with Webpack for vuejs but without polyfill required get an error during comply

Module not found: Error: Can't resolve 'fs' in '/Users/attawitkedkaew/_Code/jregister/node_modules/node-json2html' error in ./node_modules/node-json2html/node.json2html.js Module not found: Error: ...
2 votes
1 answer
617 views

json2htmled jQuery mobile button inside table td looks old, has old button inside new one after button()/refresh

I'm using this transform to build a jQuery mobile button inside of a regular table 'td': { "tag":"button", "type":"button", "id":"${idPrefix}-delete", "data-role":"button", "data-...
1 vote
1 answer
1k views

json2html eventData example

It is my understanding from json2html Usage -> jQuery that events can be hooked up inside json2html(), but there doesn't seem to be an example in Examples -> jquery. Please show a json2html ...
11 votes
2 answers
81k views

Converting JSON to HTML table in Python

I've been using the JSON library for Python to get data from JSON files using Python. infoFromJson = json.loads(jsonfile) I fully understand how to work with JSON files in Python. However, I am ...
1 vote
0 answers
101 views

Can't resolve 'fs' in angular

Getting error "Can't resolve 'fs'" in angular ERROR in ./node_modules/node-json2html/node.json2html.js Module not found: Error: Can't resolve 'fs' in 'C:\Projects\bvd-ui-app\node_modules\...
1 vote
1 answer
469 views

Incorrect results from json2html module

I've seen multiple of examples of this online, but I've not found anything that helps me solve the problem I'm faced with. I'm trying to convert a JSON object into an HTML table, but I'm faced with a ...
0 votes
1 answer
88 views

json2html is support in IE11?

Recently, I use JSON2HTML v2.1.0 javascript library. But, when I use template with function in IE11, It is not working. Here is my full HTML source code: <!DOCTYPE html> <head> <...
0 votes
0 answers
408 views

json2html rendering in a web page

I am making a basic web scraping app that dumps the results of the scraping into a JSON file. I want to display the scraping results in a table on an HTML page of the app. I am using json2html python ...
-1 votes
1 answer
104 views

TypeError: list indices must be integers, not str by json data

The whole code means scan all json files( 300+) and converter json to html. But some titles have some special characters, I have replace those first. But Traceback (most recent call last): File &...
-1 votes
2 answers
271 views

How to write python code batch convert json to html?

I have 300 + json files. The structure is like this: { "body_html": "<div><head></head><body><div class=\"lake-content-editor-core lake-engine lake-...
0 votes
3 answers
462 views

how to convert python to html in django template

I am using json2html to convert json values to html tables in my views.py render(request, 'home.html', {'value': json2html.convert(json=result)}) where result has json data. The above gives me html ...
0 votes
1 answer
85 views

Why is thing displaying to the page with this code?

My JSON is good. I've followed a very simple example from the json2html site ... nothing displays. <script type="text/javascript"> $.getJSON( "news/list/category/news/format/...
0 votes
1 answer
69 views

Insert event handler's name to json2html's template as childern

I'm using json2Html. var template = { "tag": "tr", "children": [ { "tag": "td", // "html": "<input type='radio' name='...
2 votes
1 answer
238 views

How to add click event for button in module of jsontohtml node-js (npm)

I am trying to convert JSON to HTML. I am able to create the HTML element and ID attribute. However I can not create the onclick events. I am using the npm json2htmll.js npm module. let jsontoHtml: { ...
0 votes
2 answers
240 views

Use of if (typeof(obj._source.url) !== 'undefined') expresion in jsontohtml

I am consulting two different json data sources, job1 and job2, with the same code that runs with jsontohtml. Each source has different labels, although with similar name, some have different name ...
0 votes
1 answer
94 views

Avoid using numerical references to access field values belonging to object arrays in json2html

When the json2html (https://github.com/moappi/json2html) receives a JSON with an array_of_objects. To be able to configure the transformation using the value of some object field. I'm finding that it'...
0 votes
0 answers
418 views

unable to add background color to my column in HTML document while using JSON2HTML library

I am converting a JSON file into HTML (which I am able to achieve) using "json2html" library . Apart from that, I am trying to add colorin one of the column depending upon the result. If it says true -...
0 votes
1 answer
60 views

issue passing json2html containing function thru ajax

I am trying to assign the responseText of an XHR request to an object variable that I can then pass thru json2html in order to create a form. The problem I am having is the json I'm passing has a ...
0 votes
1 answer
145 views

How to exit javascript / node.js inside HTML

I have json file ( I create this json file using node.js) that I read in HTML using json2html library and if the json file is present / readble then it will be uploaded in our server. I have ...
0 votes
1 answer
669 views

TypeError: json2html is not a function

Trying to use json2html to emit a table. Getting the error TypeError: json2html is not a function Page header has: <head> <meta charset="utf-8" /> <meta name="viewport" ...
0 votes
2 answers
1k views

JSON2html table rendered now trying to change text value color of a boolean cell

I am using JSON2html to parse dummy data into a table. The last td of each row is a boolean value. I realize that this probably a very easy thing to accomplish, but for some reason, nothing I've tried ...
1 vote
0 answers
44 views

My articles in article-section won't all start from the top, and instead are dragged down to the bottom. Why don't they generate from the top?

/*In my html page, my placeholder articles are all being dragged down by one very tall article, something that I infer is because they are being generated incorrectly, so that they are set equal at ...
-1 votes
1 answer
151 views

Why am I getting an Internal Server error

My python script runs just fine on the Apache server locally set up on my computer, however, on importing the json2html library I am getting an internal server error The moment I comment the import ...
2 votes
1 answer
107 views

How do I render a text inside a file into another html page using jQuery's json2html?

I have the following json: var data = [ { "name": "wiredep", "version": "4.0.0", "link": "https://github.com/taptapship/wiredep&...
0 votes
2 answers
399 views

How to use json2html with jquery within Angular?

I'm tasked with integrating an existing UI into another already existing Angular app and got hung up on this... I know the data + transform works well outside of the Angular context. I didn't see ...
0 votes
1 answer
88 views

How to define recursive transforms for J2H?

I'm evaluating to use J2H (http://json2html.com/examples/) to render JSON structures. My JSON are complex trees, with many repeated (recursive) structures. My question is about how to define a ...
0 votes
1 answer
2k views

How to pass the json file as input to json2html module?

I am new to python,but I have managed to write a simple code to generate json data to html format through json2html module. json2html.convert(json=input),here when I pass the json node it is working ...
0 votes
1 answer
257 views

jQuery animate table from json2html transform

I cannot animate with CSS3 because the properties are not yet standard across browsers. I can create a div table with json2html. I can animate a row by setting {height:(toggle)?'show':'hide', ...
0 votes
3 answers
336 views

How to get image element from this large div element?

So I have a template of a block of code using json2html that is var template = {'<>':'div','class':'col-lg-12 col-md-24 col-sm-24 col-xs-24','html':[ {'<>':'div','class':'product col-...
2 votes
3 answers
100 views

Content added twice though only looped once

I want to add more content to my feed making use of AJAX and it does add content - but it adds it twice. To exclude causes like the AJAX request being submitted two times I added the integer i. But i ...
1 vote
2 answers
1k views

json2html python lib is not working

I'm trying to create new json file with my custom json input and converting JSON to HTML format and saving into .html file. But I'm getting error while generating JSON and HTML file. Please find my ...
0 votes
2 answers
541 views

How to use json2html with random keys

So, I clearly understand how to transform JSON to HTML if I know what type of data i will get in json. But how can I use json2html if I don't know what kind of keys I will get from server? Here code,...
0 votes
1 answer
535 views

Each record giving separate html table using node-json2html

I am creating html table using json data and my transform is giving for each record a separate table. var data=[{"name":"aa","mid":"12345","user":"a123","password":"a@123"},{"name":"bb","mid":"2345",...
0 votes
1 answer
294 views

Python 2.7 replace all instances of NULL / NONE in complex JSON object

I have the following code.. .... rest api call >> response rsp = response.json() print json2html.convert(rsp) which results in the following error: Can't convert NULL! I therefore ...
0 votes
1 answer
312 views

Access JSON Child Node via Variable - JSON2HTML

i got the following transform template: var transform = {'<>':'li','html':'${name} - ${version} - ${licenseSources.package.sources[0].license}'}; now i want to transform a JSON into a HTML ...
2 votes
2 answers
8k views

json2html, python: json data not converted to html

I'm trying to format json data to html using json2html. The json data look like this: json_obj = [{"Agent Status": "status1", "Last backup": "", "hostId": 1234567, "hostfqdn": "test1.example.com", "...
0 votes
2 answers
392 views

How to add multiple children to parent using Json2HTML library

I want to add multiple children to parent using json2html. jsonTestSuiteTemplate={ "testSuiteNames": [{"testSuiteName": "TS1"}], }; var testSuiteHtmlTemplate = { "tag": "table", "...
0 votes
2 answers
984 views

JSON2HTML: Not a valid JSON list python

I have a piece of JSON in a file I would like to convert to HTML. I seen online there is a tool called json2html for python which takes care of this for me. [{ "name": "Steve", "timestampe": "...
0 votes
1 answer
1k views

json2html - Create inline function for JSON data in array w/ multiple elements

I have the following JSON data: {"orders":[ {"id":16,"status":"completed","total":"45.00"}, {"id":17,"status":"completed","total":"55.00"} ]} how do I transform this data to html using json2html? ${...
0 votes
2 answers
388 views

json2html how to exclude line when field doesn't exist

In json2html, if I define an element in the template that doesn't exist in the JSON, I want to "display: none;" or perhaps better, just exclude the line in some way. Example Template: {"tag":"div","...
2 votes
1 answer
674 views

How to use onclick in json2html

I am using JSON2HTML library for generating the HTML. I am having the problem with onclick.Following is the snippet of code **JavaScript** var data =[ { "testSuite":[ ...
0 votes
0 answers
357 views

How to call a function on onClick event in JSon2HTML Library

I am using Json2hTML library on click on link I want to call a function.But it is not working var data = [{ "testSuite": [{ "testCase": [{ "testCaseName": "tc1", "...
1 vote
1 answer
234 views

How to use li tag in json2html library

I am using Json2Html for converting json to Html .I am finding difficulty in using li tag.Any help is greatly appreciated. var data = [{ "testSuite": [{ "testCase": [{ ...
0 votes
1 answer
212 views

json2html how to deal with special characters (e.g. @) in json keys

The JSON response returned by a RESTful API contains the @ symbol for some keys and other keys are made in this manner ("document.title"). My piece of JSON looks like this. "fields": { "...
1 vote
1 answer
2k views

ImportError: No module named 'jsonconv'

I am running Python 3.4 Did pip install json2html with no errors. However, when I execute "import json2html" I got: >>> import json2html Traceback (most recent call last): File "<...
6 votes
6 answers
29k views

Insert into HTML select tag options from a JSON

So, here's the deal: I have a JSON object saved in my web App at localStorage. This JSON is being saved as a string, with JSON.stringify, inside one of my functions, on the page load: localStorage....
2 votes
1 answer
3k views

express.js ejs not rendering my html

I'm using Express.js with EJS to render the response from a database query as an html unordered list. I'm also using json2html. I'm not getting any errors but my list item elements are not getting ...
1 vote
0 answers
259 views

How to measure distance from JSON data that contains latitude and altitude data with geolocation?

First, sorry for my english. I'm developing an Android App using phonegap. I'm using html with css, js, and json hosted to the server. I have a .json data that contains latitude and altitude data. ...
0 votes
2 answers
370 views

Can I pull JSON from api url and use as json2html input?

I have working on a webpage that displays json data in a html hierarchical structure, using the jQuery plugin json2html. Currently the json data is entered into a text area and a button is pressed ...