Skip to content
Advertisement

Tag: json

How do I insert HTML into Mongodb?

I keep getting kicked out of the shell when I try to paste in an HTML text file. How can this be done? Do I first need to use some javascript to encode it or something? Example: EDIT I put only single quotes inside my html and wrapped the whole thing in double-quotes, but still no good. shell error: Answer

2-dimensional array to object (JavaScript)

I have an array, that holds a large number of two-dimensional arrays: I need to convert this array into an object of the following form to send it as JSON: (“s_id” should be myArray[0][0], “t_id myArray[0][1], and “type” myArray[0][2] and so on.) How can I get the array in the desired form? Thanks in advance. Answer Be aware that map

Access user email address in Meteor JS app

I am building an app using Meteor and need to access the stored email address of a logged-in user. I am currently using: to access the user. However, I am only able to access the id. The email address is stored in a nested object that looks like this: I have tried various ways to traverse the JSON object but

Unable to access JSON property with “-” dash [duplicate]

This question already has answers here: How can I access object properties containing special characters? (2 answers) How do I reference a JavaScript object property with a hyphen in it? (11 answers) Closed 3 months ago. I am unable to retrieve a value from a json object when the string has a dash character: If I try to reference the

Express and ejs <%= to render a JSON

In my index.ejs I have this code: In my node I have However, on the page I obtain and if I write I obtain: Is there a way to pass a JSON that will be JS readable? Answer Oh that was easy, don’t use <%=, use <%- instead. For example: The first one will render in HTML, the second one

How to read and write JSON offline on local machine?

Problem I need a way to store and collect JSON data in an entirely offline(!) web application, hosted on a local (shared) machine. Several people will access the app but it will never actually be online. I’d like the app to: Read and write JSON data continuously and programmatically (i.e. not using a file-upload type schema) Preferably not require any

File API – Blob to JSON

I’m trying to do some experiment with HTML5, WebSocket and File API. I’m using the Tomcat7 WebSocket implementation. I’m able to send and received text messages from the servlet. What I want to do now is to send from the servlet to the client JSON objects, but I want to avoid text message in order to skip the JSON.parse (or

Advertisement