Questions tagged as 'json'

1
answer

Ignore element in JSON with PHP

Let's say we have a JSON with 2 elements below: exemplo: { [{ "arquivo": "Arquio 1", "size": "2340" }, { "arquivo": "Arquivo 2", "size": "0" }, { "arquivo": "arquivo 3", "size": "4329" }    U...
asked by 19.04.2016 / 23:50
1
answer

Class Construction and JSON Consumption

I'm trying to consume a JSON, but in the structure I've developed the code does not return me data. Could you please help me and explain the concept of consumption and how does the JSON framework work? Code that I developed, does not return L...
asked by 25.08.2015 / 15:23
2
answers

getJSON Ajax for JSON with multiple objects

To search for data in a simple JSON , such as: { "chave1":"valor1", "chave2":"valor2" } I use something like this: $.getJSON(dados, function(json) { $.each(json, function() { $('#r').append("<p>"+this.chave1+"&l...
asked by 16.01.2016 / 07:36
1
answer

How to print a JSON array?

var listaNomeProjeto = [{ "nomeProjeto": "NomeProjeto1", "subProjeto": [ "Sub Projeto1", "Sub Projeto2", "Sub Projeto3", "Sub Projeto4", "Sub Proj...
asked by 29.07.2015 / 17:55
1
answer

How to pass a CPF as a parameter of type NSDictionary for a call with JSON and POST?

Hello, I have a question. I need to pass a user-entered CPF as a parameter in my POST call to return with his data. The call works with an already registered CPF, but only works if the CPF is passed directly as a parameter, as I did below and ty...
asked by 11.11.2015 / 03:44
5
answers

Php returns null JSON when accented in MySQL

Hello, I have the following code in php: <?php $con=mysqli_connect("localhost","user","senha","banco"); $parametro = $_GET["parametro"]; if (mysqli_connect_errno()){ echo "Failed to connect to MySQL: " .mysqli_connect_error(); }...
asked by 30.03.2016 / 19:52
2
answers

Popular table using Json

I'm having trouble populating a table in my code cshtml . I'm new to ajax and I'm not fully understanding what I need to do with the data that came from the bank. Here is my code: Code cshtml : <div><table id="data...
asked by 18.09.2015 / 20:08
2
answers

Check if default is followed, JSON and PHP

There is a small request pattern with several parameters, but I'll simplify it this way: $parametrosdBase = array('nome' => false, 'codigo' => 83474, etc.. I get a string in JSON format that should theoretically CONTAIN these paramete...
asked by 25.09.2015 / 22:31
2
answers

Is it correct to use JSON to store data that does not need to be in a database?

Ex: In the company where I work put a lot of data in my code that does not need to be in the database, but it is not actually text or content. They are a lot of validations and depending on the clause it returns a certain type of content, the pr...
asked by 24.09.2015 / 17:25
2
answers

Execute command in JS using string

I have a command to get the size of my json, but I need to use a string to indicate which object I want to get the size of: var comando = data.result[0][0].'Pedidos'.length; The error you give me is this: Uncaught SyntaxError: Unexpecte...
asked by 17.03.2015 / 17:57