Questions tagged as 'json'

2
answers

Send phrase to web service using JSON

I have a small problem when sending a phrase using JSON to a web service, if I send a string without spaces like String name="Jose" ;, there is no problem, but when trying to send a whole sentence, the consultation is not done. What would be the...
asked by 09.12.2018 / 22:48
2
answers

Is it possible to traverse a JSON with for cycle? (do not use foreach)

I have a JSON that is easy to navigate with a foreach, the structure of the JSON is the following: { "llave":"valor","llave":"valor","llave":"valor" } foreach ($arrayJson as $key => $value) { echo $key . ': ' . $val; } I would like...
asked by 21.09.2018 / 21:03
3
answers

JSON.parse: expected property name or '}' JavaScript

I have this String: [ {'lat':43.4627,'lng':-3.79636,'description':'a'}, {'lat':43.4476,'lng':-3.82948,'description':'b'}, {'lat':43.4228,'lng':-3.82391,'description':'c'} ] And when I try to validate here I get this error:...
asked by 10.05.2018 / 12:52
1
answer

how to take a data from a json object in ajax

I have this code to create a table and insert the data of the type json array: $.ajax({ url: '<?php echo base_url(); ?>index.php/Manager/metricsAdvocates', type: 'post', data: {'sup':sup, 'dateM':dateM}, dataType: 'json...
asked by 22.03.2018 / 18:26
1
answer

get the objects that are repeated in an array of JSON objects with javascript (JQuery)

I give as an example the following array of objects in JSON: [{"id":"aaa","uns":"123"},{"id":"bbb","uns":"023"},{"id":"aaa","uns":"123"},{"id":"ccc","uns":"765"},{"id":"ddd","uns":"256"}]. I would like to obtain an array with the repeated...
asked by 06.06.2017 / 10:46
2
answers

Display PDO query data in JSON format

I try to get the data from a query and print it on the screen but it does not show anything. $pdo=new PDO("mysql:dbname=usuario;host=localhost","root","root"); $statement=$pdo->prepare("SELECT * FROM usuario WHERE estado = 1 ORDER BY idusua...
asked by 02.03.2017 / 03:04
1
answer

JQuery - How to know how many elements are in a JSON file

I have my "pck.json" { "Datos": [ { "Nombre":"Alekz" }, { "Nombre":"Andrea" }, { "Nombre":"Janny" }, { "Nombre":"Haytham" }...
asked by 04.08.2016 / 16:32
2
answers

Dropdown with select2 and jQuery ajax

I am having problems trying to fill a dropdown (select) with select2 from a remote resource: I fixed my backend code so that the API returns the following JSON code: [ {"id":9,"nombre":"Jose"}, {"id":10,"nombre":"Juan"}, {"id":11...
asked by 18.10.2016 / 20:35
1
answer

Get a JSON from an SQL query in Postgres [duplicated]

I have several tables with the following data: | sonda | fecha | valor | +-------+-------------------------+--------+ | s1 | 2018-10-23 23:34:00.444 | 34.5 | | s2 | 2018-10-23 23:34:00.444 | 4.5 | | s3 | 2018...
asked by 20.12.2018 / 18:12
1
answer

How to load a Select with AngularJS and JSON

Good, I'm trying to load a select with AngularJS by calling a Json but I do not know how to do it I have this JSON angular.module('playersApp', []).controller("AllPlayerssCtrl", function ($scope) { $scope.players = [ { "p...
asked by 20.08.2017 / 21:41