Reputation: 1785
I'm using the awesome GoSquared API to get the number of current visitors on my Site.
I have build a Jquery Script, that automatically updates the number every two seconds with Jquery .get
, but this doesn't seem to work in IE and Firefox.
Thanks :)
Upvotes: 0
Views: 1716
Reputation: 16561
In Firefox data
is a string for some reason. You can specify the data type of the response explicitly:
$.get('url', function(){}, "json");
Otherwise you can turn it into an object like this:
if (typeof data === "string"){
data = JSON.parse(data);
}
Upvotes: 3