xdomain-cookies icon indicating copy to clipboard operation
xdomain-cookies copied to clipboard

location.hash var error

Open mpbunch opened this issue 6 years ago • 0 comments

JSON.parse needs a value otherwise it dies and kills the script.

Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse () at xdomain_cookie.html:8

Simple solution:

var _hash_data = '';
if(window.location.hash.substr(1)){
  _hash_data = JSON.parse(decodeURIComponent(window.location.hash.substr(1)));
}

mpbunch avatar Nov 02 '18 15:11 mpbunch