I have an AJAX function that gets JSON response. I want to convert this JSON repsonse into a global object using prototype. I don't have a clear concept of prototyping but I think my idea is correct. Forgive me if I am wrong.
Here is the code
var RatesGlobal = {};
$('#tarrif').load("<?php echo base_url(); ?>index.php/rates/index", function (data) {
RatesGlobal.prototype.tarrifRates = JSON.parse(data);
});
I want to later access the values of the JSON string, forgive me if the question is not clear enough. I don't know if this is the proper usage of prototypes. What is the right way of doing so ?