Developing an experiment with json – problems with the code
I’m trying to build an experiment on the Look it Platform which is a site that we can built behaviour experiments. It’s my first time developing an experiment in it, but I’m having great difficult with it.
How to get a json formatted file from imported object in es6?
If I have file places.mjs
Replace newlines with n
Im making forum and JSON can’t save with newlines, i can’t show code (security reasons)
I want to replace all newlines from textarea to n so later i’ll format them and done.
Content of json file is escaped
I have a javascript that creates and saves a json file wich contains a list of objects:
What is the best practice – Convert Server Side JSON data to an Explict Data Model or Use the Object as is
I am fairly new to JavaScript. I am receiving JSON data from server side, through fetch API, which is converted to a JavaScript object with Response.json(). It provides the data in object for, there are no problems. The server side returns simple Data Transfer Objects (DTOs) and the upstream routines only consume the properties.
Why doesn’t fetch() in JavaScript return JSON data?
I’m trying to use fetch() to fetch data from an API and convert it to JSON. However, I get errors or incorrect data. Here is the code I tried:
fetch(‘https://api.example.com/data’)
How do I fix a TypeError: undefined is not a function in JavaScript?
I am trying to call a function in my JavaScript code, but I keep getting the error “TypeError: undefined is not a function”. Here is my code:
Is it possible to convert a JavaScript EventSource object (its number and string properties) to JSON?
I am curious how JavaScript EventSource and other similar objects having number and string properties can be converted to JSON.
I have tried some stuff with JSON.stringify(...)
and eventSource.entries()
but I get empty JSON.
i got 2 errors while trying to import from products.json file into a main.js file
error 1:Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “text/css”. Strict MIME type checking is enforced for module scripts per HTML spec.
Formatting JSON date string to WEEKDAY, MM/DD
I need to embed a JSON feed onto our website. I have my code working, but am struggling with the JSON date format, which is producing string values like 2024-05-08 18:00:00. Ideally, I would like to format this into something like Wednesday, May 8 6:00 PM or 05/08/2024 6:00 PM or along those lines. I am not able to edit the JSON feed directly.