Permalink
Browse files

Changed eval() calls to JSON.parse()

  • Loading branch information...
thecosmicfrog committed Dec 12, 2014
1 parent a693ef9 commit 36e8c710ad9ebc4111b44e3b92df4fe1d610ca45
Showing with 2 additions and 2 deletions.
  1. +1 −1 js/getbikes.js
  2. +1 −1 js/getstations.js
@@ -12,7 +12,7 @@ WorkerScript.onMessage = function(sentMessage) {
msg = xmlHttp.responseText;

// Parse response text to usable object.
stationInfo = eval("(" + msg + ")");
stationInfo = JSON.parse(msg);

if (typeof stationInfo != "undefined") {
for (var i = 0; i < stationInfo.length; i++) {
@@ -12,7 +12,7 @@ WorkerScript.onMessage = function(sentMessage) {
msg = xmlHttp.responseText;

// Parse response text to usable object.
parsedMsg = eval("(" + msg + ")");
parsedMsg = JSON.parse(msg);

if (typeof parsedMsg != "undefined") {
for (var i = 0; i < parsedMsg.length; i++) {

0 comments on commit 36e8c71

Please sign in to comment.