Skip to content

Commit

Permalink
flag y
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasalmeida committed Aug 27, 2015
1 parent 98894d9 commit b56c489
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openHealth.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ this.getJSON=function(url,fun,store){
if(!this.getJSON.cache){ // if caching not enabled
if(!store){store=openHealth.getJSON.store}
this.xhr(url,function(x){
fun(JSON.parse(x.target.responseText))
var y = JSON.parse(x.target.responseText);
fun(y)
if(store){localforage.setItem(encodeURIComponent(url),y);} // if store is true cache nonetheless
});
} else {
Expand Down

0 comments on commit b56c489

Please sign in to comment.