⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Editing: Unexpected token < in JSON at position 0



vasco
  • profile picture
  • Member

Posted 05 June 2019 - 03:55 AM

Hi everyone. I can´t update any row, keep having this error in Chrome Console (No error on html front, just nothing happen). I can add new rows, same as delete them. But with Edit/Clone, I can figure what is going wrong.

 

Full error msg:

 

Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at Function.parse [as parseJSON] (<anonymous>)
    at Object.success (edit.js:37)
    at Object.b.success (global-libs.min.js:7)
    at c (jquery-1.11.1.min.js:264)
    at Object.fireWith [as resolveWith] (jquery-1.11.1.min.js:266)
    at l (jquery-1.11.1.min.js:659)
    at XMLHttpRequest.<anonymous> (jquery-1.11.1.min.js:665)

I´ve checked on network to see what is recieving the server and the info is correct.

 

Thanks in advance!


karlochev
  • profile picture
  • Member

Posted 21 June 2019 - 16:18 PM

Hi,

 

I solved it by changing "<" to "& lt;" and ">" and other special characters, for their corresponding html character. The message returned must be simple text. You can verify it by changing the return on the function: "insert_layout" in the library Grocery_CRUD.php.

 

 

Hi everyone. I can´t update any row, keep having this error in Chrome Console (No error on html front, just nothing happen). I can add new rows, same as delete them. But with Edit/Clone, I can figure what is going wrong.

 

Full error msg:

 

Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at Function.parse [as parseJSON] (<anonymous>)
    at Object.success (edit.js:37)
    at Object.b.success (global-libs.min.js:7)
    at c (jquery-1.11.1.min.js:264)
    at Object.fireWith [as resolveWith] (jquery-1.11.1.min.js:266)
    at l (jquery-1.11.1.min.js:659)
    at XMLHttpRequest.<anonymous> (jquery-1.11.1.min.js:665)

I´ve checked on network to see what is recieving the server and the info is correct.

 

Thanks in advance!