Added conditional statement for browsers with JSON issue

I came up with a fix for browsers that read the returned ajax data as text instead of an object.
Set the ajax data to a variable with a conditional that if data is text then use `JSON.parse(data)` otherwise simply pass the data.
I have tested this on WaterFox and PaleMoon (the 2 browsers with the known issues) as well as vanilla FireFox, Chrome and IE10 and it all works nicely.