JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

QuestionsJSON.parse: unexpected end of data at line 1 column 1 of the JSON data
Massimo Gagliardi asked 8 years ago

In the subgrid using inline mode when I add a new record the grid doesn't refresh. To have add icon available I must refresh it manually.

Firebug shows this:
SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
…tion(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(…

The ajax call seems ok:
IDStagione=154&CodMateriale=&IDMateriale=&CodM2=&IDM2=&IDArticolo=926&IDF=&IDFase=&Importi=&Misure=&Descrizione
=&IDUnitaMisura=3&Quantita=86&ImportoUnitario=8.2&Imponibile=00&IDCodiceIva=8&Iva=00&Totale=00&DataAggiornamento
=&IDOperatore=&oper=add&Progressivo=jqg3

I don't understand.
Could you help me?
Thanks in advance
Massimo Gagliardi

1 Answers
Abu Ghufran answered 8 years ago

The ajax call returns json, e.g.

$insert_id = 222;
$res = array("id" => $insert_id, "success" => true);
echo json_encode($res);

If you are using custom event and not returning json, it may raise this issue.

Your Answer

5 + 6 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?