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 3 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

2 Answers
Abu Ghufran answered 3 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.

Opencart answered 2 years ago

Hi all,
Finally we get the solution for the order edit error "SyntaxError:

JSON … ok" in OpenCart 2.0.1.0, 2.0.1.1, 2.0.2.0, 2.0.3.1, 2.1.0.1,

2.1.0.2, 2.2.0.0, 2.3.0.0, 2.3.0.1, 2.3.0.2 If you really want to get

the solution for the order edit error in your OpenCart store then

visit us and contact through GET A QUOTE message or place a support

ticket by the links below respectively.

http://opencartprogrammer.com/

http://opencartprogrammer.com/helpdesk/

Our support team will get back to you soon.

thanks
Opencartprogrammer team

Your Answer

0 + 7 =

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 / 5. Vote count:

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

Let us improve this post!