Questions tagged [json]

JSON (JavaScript Object Notation) serves as a versatile data exchange format that can be easily understood by both machines and humans. Please refrain from employing this label when referring to native JavaScript objects or JavaScript object literals. Prior to seeking assistance, ensure the validity of your JSON through an esteemed validator like JSONLint (https://jsonlint.com).

Exploring the wonders of jquery's JSON parsing capabilities

Having trouble parsing the JSON data that is out of my control. Can anyone help me figure out what I'm doing wrong here? data.json { "img": "img1.jpg", "img": "img2.jpg", "size": [52, 97] } { "img": "img3.jpg", "img": "img4.jpg", "size": [5 ...

The JSON data was retrieved in a different order compared to the text data during scraping

Attempting to retrieve data from www.crunchbase.com through their API, I created a basic Python script for fetching responses. However, when writing the json_data to a file, I noticed that the order of the keys does not match the response order obtained di ...

Revamp intricate JSON array with Jolt for optimum transformation

When working with an external API, I am receiving a complex JSON structure that needs to be transformed into a simpler JSON format according to our requirements. Although Jolt has the capability to transform JSON, I'm struggling to devise the appropriate J ...

"Using PHP to encode an array into JSON format might result in additional

My PHP array needs to be printed as clean JSON, but I'm encountering issues with extra quotes. While the current JSON output is technically valid, it's not formatted how I want it to be. Below you can see the original PHP array, the json_encode output, and ...

Traverse through the JSON object in PHP

I have a piece of code that loops through a JSON object. The goal is to display one object from the JSON if isset($_GET['latest=1'])), and 15 objects if latest=15. How can I achieve this? <?php header('Content-Type: application/json&apos ...

Failed to save information in JSON format

I'm currently facing an issue with JSON while trying to implement a register and login feature. The data fails to be stored as intended. Here is the JSON response I am receiving in the log: 02-24 08:24:47.878: E/JSON(2017): {"tag":"register","success":0," ...

Deciphering complex JSON structures in PHP

I've come across a JSON structure that I need to parse. While I have managed to extract individual nested objects, it feels like there should be a simpler way to achieve this without having to search for each nested structure. Here is an example of the JS ...

Display JSON data as a table in PHP

The functionality of this code is to retrieve data from a JSON file and present it in a table format. However, instead of seeing the expected entries in the table, all I'm getting is an empty table. I'm open to any suggestions about what might be causing t ...

What are the reasons for the failure of parsing this specific Twitter JSON file using Angular $http, and how can I troubleshoot and resolve the issue

After finding a JSON example on the following website (located at the bottom): , I decided to save it to a file on my local system and attempt to retrieve it using Angular's $http service as shown below: To begin, I created a service: Services.TwitterSer ...

Dealing with null values from JSON when a list view row is clicked: Tips and suggestions

My knowledge of Java is limited, but I managed to pull data from an API to a list view successfully. However, when trying to display more details upon clicking on an item in the list view, I encountered errors related to handling null results in my text vi ...

Is there a solution to address the error message: json.decoder.JSONDecodeError: Expecting value at line 1, column 1 (character 0)?

I am currently working on developing a REST API that involves handling JSON files. One particular aspect of the project requires me to open a JSON file, check for specific content existence, and add it if necessary. To achieve this, I need to load the JSON ...

Looking for dates within JSON data using Python

Seeking advice on efficiently searching through JSON data to find today's date/time and retrieve the corresponding value. Here is a snippet of the JSON data structure: [ { "startDateTime": "2018-04-11T14:17:00-05:00", "endDateTim ...

Deconstructing a JSON Structure

I'm currently developing a D3 damage per second (DPS) calculator and encountering an issue with a JSON object. The JSON object I receive looks like this: {"Sockets":{"min":1,"max":1}, "Dexterity_Item":{"min":165,"max":165}, "Durability_Cur":{"min":581,"ma ...

How to efficiently use nested $.each() in DataTables with jQuery

After receiving Json data from the server, I utilize DataTables to display the information accordingly. The json contains multidimensional arrays with rows consisting of columns that may have more than one value. Here's an excerpt: { "info_table": [ ...

Refreshing iOS UiCollectionView with a custom UiCollectionViewLayout

Currently, I am facing a small issue while attempting to implement a custom UiCollectionViewLayout into my project. The objective is to fetch JSON data from the web and display it in a UICollectionView. However, when I integrate my own layout instead of us ...

Creating dynamic forms using AngularJS with a click event for the action button

I am looking to dynamically generate form fields based on the JSON structure. Currently, I have successfully rendered the fields on the webpage using a JavaScript file. However, I need assistance in adding action items to the "button" part. For example, I ...

Parsing and transforming Cyrillic Unicode characters from a JSON file using C++

I have a JSON file containing the following data (as an example): { "excel_filepath": "excel_file.xlsx", "line_length": 5.0, "record_frequency": 2.5, "report_file_name": "\u041f&bs ...

Submitting a nested JSON object in an AJAX request

When it comes to passing nested JSON through AJAX, the format of the sample request should be like this: { 'user': { 'email': email, 'password': password } } login(){ var email=document.getElementById('username').value; var ...

Exploring a JSON Object with nested properties, crafting changes, and producing a fresh object: A step-by-step guide

I am attempting to manipulate a JSON object with nested properties by replacing numeric values with computed values and returning a new object. The original object looks like this: var obj = { "a0": { "count": 41, "name": "Park", "new": { ...

Display the JSON data on the homepage

I am struggling to figure out why I can't successfully display the JSON data on my webpage. As a newcomer to JavaScript, I am eager to showcase the contents of a JSON file within my index file. After utilizing the express generator for all my files, ...

Struggling to interpret JSON and retrieve the desired value

Just starting out in Go Lang and looking to parse a JSON structure like the one below to extract all objects in the records array. [ { "records": [ {"name":"value"},{"name":"value"} ] }, { "records": [ ...

I'm having trouble understanding why I keep encountering this error message: "SyntaxError: Unexpected token T in JSON at position 0 at JSON.parse (<anonymous>) at XMLHtt…"

I am in the process of implementing a download button feature that will allow users to download a document from my node.js server. Check out this stylish button: https://i.stack.imgur.com/s4CjS.png For the front-end, I am utilizing Angular as the fram ...

Issue with AJAX and Jquery auto form update functionality malfunctioning

On my form page, here is the code snippet: <form action="/register-process" method="post" id="form1"> <script type="text/javascript"> jQuery(document).ready(function($) { $(document).on('focusout', '#dateenglish', function () { var dateeng ...

Arrange the JSON attributes in reverse order

Given the JSON data provided, how can I sort the "c" value in descending order? [{"id":"2","val":"2pm.com","c":"4"}, {"id":"2","val":"Adidas","c":"2"}, {"id":"2","val":"AJ Morgan","c":"2"}, {"id":"2","val":"Alfio Raldo","c":"3"}, {"id":"1","val":"ASOS"," ...

Is it possible to utilize Shared Preferences in a class without the need to extend AppCompatActivity?

When attempting to utilize shared preferences in my class, I encounter an error message stating "Cannot resolve method 'getSharedPreferences(java.lang.String, int)'. Here is the snippet of code: public class FetchData extends AsyncTask<Void, ...

Creating a dual-field autocomplete feature with jQuery and JSON data

I've been experimenting with jQuery's autocomplete widget and have hit a bit of a snag. I could really use some advice or guidance. Basically, I'm working on a form where users can input the name of a person, and then jQuery will search the ...

Navigating forward slashes in JSON within a Java/Spring application: tips and tricks

In my application, I have a function that efficiently parses JSON data received through Postman and uses the GSON library to populate an object. The object is then returned as JSON to the user. However, there is one issue with this process - one of the va ...

transforming a string into a pandas dataframe using Python

I have a String variable with data that I would like to convert into a data frame using Python. I need someone to provide guidance on how to proceed. Data : data1 Name Space -------------------- ...

Retrieving JSON data value without a key using AngularJS

I am struggling to retrieve a data value from a JSON array in Angular that does not have a key value. While I have come across examples of extracting values with keys, I haven't been able to crack this particular piece. The JSON returned from the API is c ...

Converting a JSON object to a string in Java

I am working with a JSON file and looking to convert it from JSON to string using the org.simple.json library. { "header": { "IssuerID": "000141", "AuthenticationID": "e07020c0d040a050a0808099", "AuthenticationDateTime ...

Tips for manipulating JSON data in Azure Data Factory

Received the data in env_variable.json using a Lookup variable and looking to extract "NO" and "BR" programmatically for iteration within a ForEach activity. The content of the file is as follows: { "countries" : { "NO" : { "wells": ["0015/abcd"] }, "BR" ...

A step-by-step guide on retrieving JSON information and saving it as a CSV file

Click here for JSON data on COVID-19 mobility trends. Here is a snippet of the JSON data: { "data": { "Albania": [ { "name": "driving", "title": "driving", "values": [ { "date": "2020-01-13", "value": "100" }, { "date": "2020-01-14", "value": "95.3" }, { ...

Navigating a JSON dictionary using Python's programmatic approach

In my code, I am attempting to assign a value from a dictionary that has been formatted in JSON to a variable. Here is the JSON-formatted dictionary: "Monetarios": [{"MIFID_NO_CURR_RISK":"B1"},{"MIFID_CURR_RISK":"B2"}], "Monetario Dinamico": [{ ...

Enhancing efficiency in a node.js application through utilization of data stored in a json file

I have a unique requirement in my application to showcase the states of different chemical elements based on specific values. The essential data is stored in a JSON file containing all the necessary information about each element. { "1":{ &qu ...

What is the most effective way to retrieve JSON data from a custom SQL query?

I'm working with this PHP code snippet: <?php $servername = "host"; $username = "user"; $password = "passw"; $dbname = "dbname"; $conn3 = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $conn3->setAttribute(PDO::ATTR_ERRMOD ...

Passing a JavaScript variable to PHP resulted in the output being displayed as "Array"

After sending a JavaScript variable with the innerHTML "Basic" to PHP via Ajax and then sending an email with that variable, I received "Array" instead of "Basic". This situation has left me puzzled. HTML: <label class="plan-name">Plan name: <b ...

"Problem arises when using cts.jsonPropertyScopeQuery and cts.jsonPropertyValueQuery as it pertains to data types and the order

I am currently working with MarkLogic 9 in my database. Within my database, I have generated the following documents: test1.json { "users": [ { "userId": "A", "value": 0 } ] } test2.json { "users": [ ...

Tips for handling function calls that result in RuntimeExceptions in Java?

I have to utilize tapestry-json as my JSON-API in Java: import org.apache.tapestry5.json.JSONObject; import org.apache.tapestry5.json.JSONArray; Unfortunately, there is no method called optJSONObject(int) to read JSONObjects from a JSONArray. Instead, th ...

Developing an interactive menu for mobile devices utilizing a combination of JSON, HTML, JavaScript, and CSS

Creating a custom dynamic menu for mobile platforms using HTML, JavaScript, and CSS with a JSON object downloaded from the server. Not relying on libraries like jQuery. I've come across advice stating that "document.write" should not be used in event ...

Discover the power of Snowflake's lateral flatten function in exploding multiple JSON values within nested JSON lists!

I have a variant table containing 24 JSONs that look like the following (one per row): { "context": "marketplace", "metadata": { "app_version": "1.0.4 (166)", }, "params": { " ...

Transmitting unique characters, such as a caron symbol, via xmlhttp.responseText and encoding them with json_encode

I am struggling to retrieve data from a database that contains a special character (caron) and then pass it through xmlhttp.responseText using json_encode to fill textboxes. However, the textbox linked to the data with the special character (caron) is not ...

What is the best way to extract JSON data that has already been double quoted in Objective-C?

Can you help me with parsing JSON data that is already double-quoted? For example, say we have received the following JSON: "first_name" = Noah; Here is the code I have tried: //"first_name" = Noah; NSString *name=[result valueForKeyPath:@"first_name"] ...

Decode JSON with an integer as the key

Alright, so here's the situation. I've got this massive JSON feed and everything is running smoothly. However, there's just one small hiccup Currently, my approach involves: $json=file_get_contents($source); $data = json_decode($json,true) ...

Using JSON in C# for dynamic serialization and deserialization operations

I am currently exploring the concept of dynamically serializing and deserializing JSON objects, as opposed to programmatically. As a Software Engineering student, I am delving into JSON and have developed a class for serialization and deserialization purpo ...

Isn't AJAX all about the same origin policy?

Despite my confusion surrounding the same domain origin policy and jQuery AJAX, I have noticed that when I make a GET request to a URL using jQuery, I am able to successfully retrieve the results. This goes against what I understood about the restriction ...

What is the best way to transfer the data from one JavaScript object to a new, empty object?

My Angular site requires a JavaScript object (JSON retrieved from a database) to display widgets: [{'widget_id':'1','widget_name':'Blue Widget','widget_description':'A nice blue widget','widget_discount':'20'},{'widget_id':'2','widget_name':'Red Widget',' ...

Seeking a solution for inserting input values into a JSON file within a node.js environment

As I was developing my new project, a to-do list web application, Below is the code snippet from 'todo.html' : <html> <head> <title>My TODO List</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jqu ...

Developing Attributes in JSON

Greetings stackOverflow Community, I'm struggling a bit with creating JSON objects. I have code snippet that is meant to populate a list called members with names, and then add a property to each of those names. Here is the specific snippet in question: ...

Python code for performing a surgical replacement of a JSON field with another in a file

Currently, I am dealing with a large collection of JSON files structured like this: File00, timestamp T1: { "AAA": { "BBB": { "000": "value0" }, "CCC": { "111": "value1", "222": "value2", "333": "value3" }, " ...

Converting a JSON file embedded in pandas python to a CSV format

Hey there! I recently received a JSON file with the following format. Can you guide me on how to parse this JSON file and convert it into CSV? JSON File Format {'Sections': [{'MC': [[{'IsMandatory': False, 'LD': None, 'propNameValuepair': [{' ...

Retrieving data with jSON through the local storage API

Seeking assistance with a problem I'm facing. Being new to this, the textbook Headfirst into programming isn't very helpful in explaining. After researching on stackoverflows, I'm still struggling. Any guidance would be greatly appreciated. Thank you! The ...

Query: Employ regex to pick out property values

Here is the json Object I am working with: { "foo": { "name": "Name 1", "color": "green", "something_else": { "name" : "Name 2" } }, "bar": { "name": "Something else", "color": "red" ...

Refine the Crossfilter dimension according to the specified date range

What is the proper way to filter a date range using Crossfilter? The code above does not seem to yield any results, but I am certain that there are records within that specified time period. Var myDimension = CrossFilterObj.dimension(function(d) { retur ...

Getting JSON object string in Node.js using Express

I am currently utilizing Polymer's <iron-ajax> to send data, in the form of a JSON string created using JSON.stringify, to a Node Express server. However, upon receiving the data, it appears in a strange format that I am unable to parse. Specifically ...

Create a Python function that takes a list as input, iterates through each element, converts it to

When working with a Python list that requires double quotes around the strings in order to pass it to an API as a list of double quote strings, I encountered an issue. The data needed by the API: data = { "styles" : styleList } It worked when I manu ...

Importing data from a CSV file into a Google Spreadsheet using the Python programming language

I am currently working on a Python script to transfer data from a CSV file to a Google Spreadsheet. While I have a good grasp of the fundamentals required for this project, I am struggling with formatting and parsing the data from the CSV file into the Goo ...

Discovering the value of an object through its prototypes

Is it possible to create a function that can locate the value "5" within an object's prototype? What is the proper algorithm to achieve this? var rex = { "Name": "rex", "Age": 16, } te = { "to": 5, } rex.te = Object.create(te); function findValue(a,b ...

Constant price updates through an API loop

I am transferring data from a spreadsheet to a dataframe that includes product details, which I need to update prices in an e-commerce via a put request through an API. However, I am facing the challenge of creating a loop to properly iterate through the e ...

Saving data in a JSON format within the browser's localStorage, whether it be a nested object-tree or a collection

In a scenario with two JSON objects, Car and Wheel, where Car contains a collection of Wheel along with other primitive-type properties: Car: Name Speed Wheels Wheel: Thickness Friction When considering saving this car using localStorage, there are ...

Loading data into a grid in Ext JS 3.4 using an AJAX request

After receiving a JSON string response from my web service in Extjs 3.4 with the message: {"msg":"Some"}, I am looking to display this 'Some' data in a grid. Ext.onReady(function(){ var store = new Ext.data.JsonStore({ url: "my/json/url. ...

Convert the Include/require output to JSON encoding

I have a fully developed PHP application that was not created following the MVC design pattern and lacks a templating system like Twig. The issue I am facing is that instead of receiving a variable that stores the template (HTML output), it directly print ...

Incorporating local JSON data into HTML: A Step-by-Step

I'm completely new to javascript and the utilization of json. What I want to accomplish is quite straightforward, although I am encountering difficulties. My objective is to create a website consisting of two pages: one that showcases artists and another ...

Using XSLT to generate default XML nodes when a corresponding JSON element is missing

I am working with JSON structured as follows: { "Message" : { "dynamicFields" : [ { "alias" : "TEST_ALIAS", "value" : "VALUE" } , { "alias" : "CAR", "value" : "TOYOTA" } ] } } My XSLT style ...

Using Flask to send and receive JSON requests with boolean values

How can I include a boolean value in the request body using the Python requests library? I attempted: request_body = {'someBooleanValue': true}. => NameError: name 'true' is not defined request_body = {'someBooleanValue': ...

Error Alert - Troubleshooting AJAX JSON Parsing Issue

I've encountered a problem with AJAX that involves parsing a JSON Array from a webservice I am developing. The front-end of my project uses a simple combination of ajax and jQuery to showcase the results retrieved from the webservice. Despite being certai ...

Updating the code for Express to store JSON data in a database field

Struggling with setting up my first basic CRUD functionality in Express JS and I can't seem to track down this frustrating bug. Every time I attempt to update a field, instead of displaying the new data, the JSON from that field is shown on the view. ...

What is the best way to delete JSON properties that have a certain name from a collection of objects?

My attempt to remove JSON properties by a specific "key" did not yield the expected results. Despite my efforts, the code remains unchanged. This is what I did void Start() { var foodlist = new List<Food>() { new() { name = "Banana", ...

What is the process of obtaining the Album ID?

Can someone help me identify the unique identifier in this URL? I don't need to use any coding, I just require the number for a JSON script that is already functional. Although I am able to extract the correct number from other pages, I can't s ...

What is the best way to interpret this supposedly JSON structure?

I have a large data file in the format below, which is the response from an API call to one of Twitter's APIs. I need to extract the "followers_count" field value from it. Typically, I would use jq with the command: cat | jq -r '.followers_count ...

Learn how to incorporate JSON data into your Wind Rose Polar Highchart rather than using traditional table data

data: { table: 'freq', startRow: 1, endRow: 17, endColumn: 7 }, Seeking assistance on how to implement JSON for a Wind rose polar highchart instead of using table data. https://jsfiddle.net/id10922606/26njzy7k/1/ ...

Manipulate JSON insertions and character replacements using JavaScript or Python

I have a JSON file that contains an array of 500 objects. The structure of each object is as follows: { "books":[ { "title":"Title 1", "year":"2012", "authors":"Jack ; George", }, { "title":"Title 2", "year":" ...

How can I convert JSON data from an array to an array of objects using JavaScript?

My goal is to load data into an ag-grid. I have obtained the json data in the following format: {"my_data":{"labels":[1,2,3,...], "idx":["idx1", "idx2", ...]}} In order to pass it to the grid, I need to transform it to this format: {"my_data":[{"labels" ...

Basic asynchronous JavaScript and XML (AJAX) call

I am currently learning about ajax and experimenting with a script that involves extracting information from a JSON object and displaying it on the document. Below is an example of the JSON file named companyinfo.json: { 'id':1, 'name':'Stack' } The Aja ...

Mastering the Art of Parsing Complex JSON Data

I received a JSON output that looks like this. Using getjson, I'm trying to extract the datetime and value fields (italicized and bolded) such as [16:35:08,30.579 kbit/s],[16:35:38,23.345 kbit/s]. Is there any solution to achieve this? Thank you. { ...

Update Android profile in MySQL table

I am currently working on an Android application for profile updates. Unfortunately, I am encountering an issue with retrieving JSON values as the result is coming back null. Can anyone help me pinpoint where the mistake might be? Profile Update Response: ...