Title: Uncaught SyntaxError
Last modified: January 24, 2018

---

# Uncaught SyntaxError

 *  [N3gATiVE](https://wordpress.org/support/users/n3gative/)
 * (@n3gative)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-3/)
 * Hello,
 * I’m using a theme called Bellevue from themeforest which comes with WP booking
   system but from the time of purchase i’m facing a problem with calendar for which
   which i did contact theme developer but unable to get correct solution yet so
   maybe if you can help will be nice.
 * Problem was lets say we create a new Calendar in admin panel after that i selected
   Start date 01 Jan, end date 10 Jan, Status to Booked and click Apply Changes 
   it works and all dates gets booked, after that if i will select any other date
   to change its status to booked or available then it will not work this works 
   only once and if i try to change again it just throws error in console:
 * Uncaught SyntaxError: Unexpected number in JSON at position 1
    at JSON.parse (
   <anonymous>) at HTMLInputElement.<anonymous> (wpbs-admin.min.js:1) at HTMLDocument.
   dispatch (load-scripts.php:3) at HTMLDocument.r.handle (load-scripts.php:3)
 * (anonymous) @ wpbs-admin.min.js:1
    dispatch @ load-scripts.php:3 r.handle @ load-
   scripts.php:3
 * VM1941:1
 * So is there anything you can suggest for fixing?
 * Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-3/#post-9905158)
 * Same issue here.
 *     ```
       wpbs(document).on("click", "#calendarBatchUpdate", function(a) {
               a.preventDefault();
               var s = wpbs(".wpbs-calendar-data").attr("data-info");
               s = s ? JSON.parse(s) : {}; // <-- this line errors
               ...
       ```
   
 * This is the content of the `data-info` attribute.
 *     ```
       {--DOUBLEQUOTE--2018--DOUBLEQUOTE--:{--DOUBLEQUOTE--1--DOUBLEQUOTE--:{--DOUBLEQUOTE--22--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--23--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--24--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--25--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--26--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--description-22--DOUBLEQUOTE--:--DOUBLEQUOTE--door Danny--DOUBLEQUOTE--,--DOUBLEQUOTE--description-23--DOUBLEQUOTE--:--DOUBLEQUOTE--door Danny--DOUBLEQUOTE--,--DOUBLEQUOTE--description-24--DOUBLEQUOTE--:--DOUBLEQUOTE--door Danny--DOUBLEQUOTE--,--DOUBLEQUOTE--description-25--DOUBLEQUOTE--:--DOUBLEQUOTE--door Danny--DOUBLEQUOTE--,--DOUBLEQUOTE--description-26--DOUBLEQUOTE--:--DOUBLEQUOTE--door Danny--DOUBLEQUOTE--},--DOUBLEQUOTE--2--DOUBLEQUOTE--:{--DOUBLEQUOTE--1--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--2--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--3--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--4--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--5--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--6--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--7--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--8--DOUBLEQUOTE--:--DOUBLEQUOTE--1--DOUBLEQUOTE--,--DOUBLEQUOTE--description-1--DOUBLEQUOTE--:--DOUBLEQUOTE--geboekt door Erik--DOUBLEQUOTE--,--DOUBLEQUOTE--description-2--DOUBLEQUOTE--:--DOUBLEQUOTE--geboekt door Erik--DOUBLEQUOTE--,--DOUBLEQUOTE--description-3--DOUBLEQUOTE--:--DOUBLEQUOTE--geboekt door Erik--DOUBLEQUOTE--,--DOUBLEQUOTE--description-4--DOUBLEQUOTE--:--DOUBLEQUOTE--geboekt door Erik--DOUBLEQUOTE--,--DOUBLEQUOTE--description-5--DOUBLEQUOTE--:--DOUBLEQUOTE--geboekt door Erik--DOUBLEQUOTE--,--DOUBLEQUOTE--description-6--DOUBLEQUOTE--:--DOUBLEQUOTE--geboekt door Erik--DOUBLEQUOTE--,--DOUBLEQUOTE--description-7--DOUBLEQUOTE--:--DOUBLEQUOTE--geboekt door Erik--DOUBLEQUOTE--,--DOUBLEQUOTE--description-8--DOUBLEQUOTE--:--DOUBLEQUOTE--geboekt door Erik--DOUBLEQUOTE--}}}
       ```
   
 * So it looks like you are somehow applying your own encoding on the attribute,
   which messes up the call to `JSON.parse`.
    -  This reply was modified 8 years, 4 months ago by [Danny van Kooten](https://wordpress.org/support/users/dvankooten/).
 *  [wpbookingsystem](https://wordpress.org/support/users/wpbookingsystem/)
 * (@wpbookingsystem)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-3/#post-9905386)
 * Thanks for reporting. Looking into this now…
 *  [wpbookingsystem](https://wordpress.org/support/users/wpbookingsystem/)
 * (@wpbookingsystem)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-3/#post-9907507)
 * Thanks for reporting. We solved some related issues lately, but seems like we
   forgot this part :/
 * [@n3gative](https://wordpress.org/support/users/n3gative/) Will send the fixed
   version to Bellevue soon, so they can apply it to their theme.
 * [@dvankooten](https://wordpress.org/support/users/dvankooten/) We already had
   some mail contact, will send a second fixed version soon.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Uncaught SyntaxError’ is closed to new replies.

 * ![](https://ps.w.org/wp-booking-system/assets/icon-256x256.gif?rev=2691961)
 * [WP Booking System - Booking Calendar](https://wordpress.org/plugins/wp-booking-system/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-booking-system/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-booking-system/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-booking-system/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-booking-system/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-booking-system/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [wpbookingsystem](https://wordpress.org/support/users/wpbookingsystem/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-3/#post-9907507)
 * Status: not resolved