Guest User

Untitled

a guest
Apr 22nd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. Uncaught SyntaxError: Unexpected token u in JSON at position 0
  2. at JSON.parse (<anonymous>)
  3. at buscaConta (principal.html:114)
  4. at HTMLButtonElement.onclick (principal.html:99)
  5. buscaConta @ principal.html:114
  6. onclick @ principal.html:99
  7.  
  8. div class="formu" id="formularioDeIdent" style="display:none">
  9.  
  10. <p class="textoForm"> Informe seu nome: </p>
  11.  
  12.  
  13. <form>
  14.  
  15. <div>
  16. <label for="nome"> Nome: </label>
  17. <input type="text" id="nome" />
  18. </div>
  19.  
  20.  
  21. <div class="centralizar">
  22. <br><br>
  23. <button class="botaoPequeno" type="button" onClick="buscaConta()">Buscar sua conta</button>
  24. </div>
  25. <br><br>
  26. <div class="centralizar" style="display:none">
  27. <br><br>
  28. <button class="botaoPequeno" type="button" onClick="mudaMenu('formularioDeIdent', 'menu2')">Prosseguir</button>
  29. </div>
  30.  
  31. </form>
  32.  
  33. </div>
  34.  
  35. <script>
  36. function buscaConta(){
  37. var name = document.getElementById('nome');
  38.  
  39. //O ERRO OCORRE NA LINHA ABAIXO:
  40. console.log(JSON.parse(localStorage[nome.value]).valueOf());
  41. //console.log(oCliente);
  42. }
  43. </script>
Add Comment
Please, Sign In to add comment