2
I am using Angularjs in my Node application. When I try to open another Tab also with my application in the same browser ( or open another instance of the same browser ) I get this error:
s:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0(anonymous function) @ utils.js:14
angular.js:13236 SyntaxError: Unexpected token u in JSON at position 0
at Object.parse (native)
at new MyController (http://meuProjeto/my.controller.js:8:28)
at Object.invoke (http://meuProjeto/js/libs/angular-1.5.0/angular.js:4604:19)
at extend.instance (http://meuProjeto/js/libs/angular-1.5.0/angular.js:9855:34)
at nodeLinkFn (http://meuProjeto/js/libs/angular-1.5.0/angular.js:8927:34)
at compositeLinkFn (http://meuProjeto/js/libs/angular-1.5.0/angular.js:8226:13)
at publicLinkFn (http://meuProjeto/js/libs/angular-1.5.0/angular.js:8106:30)
at http://meuProjeto/js/libs/angular-1.5.0/angular.js:1696:27
at Scope.$eval (http://meuProjeto/js/libs/angular-1.5.0/angular.js:16820:28)
at Scope.$apply (http://meuProjeto/js/libs/angular-1.5.0/angular.js:16920:25)(anonymous function) @ angular.js:13236
in my script utils.js
in line 14 has the following command:
var param = JSON.parse(window.sessionStorage.param);
I know it’s very generic what I posted, but I’m new to WEB development and I’m posting this hoping that someone has been through the same problem (or something like that) and can guide me! I have no idea where to start looking for a solution, posted so too.
If necessary I can add some information that is relevant and I have not put here.
From now on, thank you!
Thank you for the reply and the explanation Onosendai . I will test your answer and as soon as I finish I will mark it as correct!
– Pedro Mota
In the links you provided, I found one of them explaining the use of sessionStorage and localStorage. I changed how you said sessionStorage by localStorage and apparently everything is ok! Thanks for the reply!
– Pedro Mota
I’m glad it worked. Feel free to ask if you have any other questions!
– OnoSendai