⚠ 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

data is saved in db, but form wont close itself and go to list view [shows 'Uncaught SyntaxError: Unexpected token g' on console]



Sam Stha
  • profile picture
  • Member

Posted 15 September 2014 - 02:16 AM

Firefox::

error on console:

SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line 1 column 131 of the JSON data

POST Insert response:

{"success":true,"insert_primary_key":48,"success_message":"<p>Your data has been successfully stored into the database. <a class='go-to-edit-form' href='http:\/\/localhost\/outsource\/jenish\/explorer-travel-system.com\/admin\/packages\/index\/edit\/48'>Edit Packages<\/a> <\/p>","success_list_url":"http:\/\/localhost\/outsource\/jenish\/explorer-travel-system.com\/admin\/packages\/index\/success\/48"}
 
 
 
 
On chrome::
console:
Uncaught SyntaxError: Unexpected token g

karlochev
  • profile picture
  • Member

Posted 21 June 2019 - 16:14 PM

Hi,

 

I solved it by changing or delete the chars "<" to "&lt;" and ">"... and other special characters, for their corresponding html character. 

 

 

 

Firefox::

error on console:

SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line 1 column 131 of the JSON data

POST Insert response:

{"success":true,"insert_primary_key":48,"success_message":"<p>Your data has been successfully stored into the database. <a class='go-to-edit-form' href='http:\/\/localhost\/outsource\/jenish\/explorer-travel-system.com\/admin\/packages\/index\/edit\/48'>Edit Packages<\/a> <\/p>","success_list_url":"http:\/\/localhost\/outsource\/jenish\/explorer-travel-system.com\/admin\/packages\/index\/success\/48"}
 
 
 
 
On chrome::
console:
Uncaught SyntaxError: Unexpected token g