I tried to create a small function, it looked like this:
$(document).ready(function(){
var value0;
$.get( "file.php?id=1", function(data){
value0 = data;
});
arrayAmount[0]=value0;
var value1;
$.get( "file.php?id=2", function(data){
value1 = data;
});
arrayAmount[1]=value1;
var value2;
$.get( "file.php?id=3", function(data){
value2 = data;
});
arrayAmount[2]=value2;
}
function buyVps(){
var vpsDetails='Processor : '+arrayProcessor[sliderValue]+' GHZ'+'\nRAM : '+arrayRam[sliderValue]+' MB'+'\nRAID Storage : '+arrayStorage[sliderValue]+' GB'+'\nMySql Databases : '+arrayMySqlDB[sliderValue]+' GB'+'\nMonthly Price : '+'R$ '+arrayAmount[sliderValue];window.open(arrayLink[arrayBlocks[sliderValue]], '_blank');
};
I need it to take the value that is returned when the URL is accessed. It is not in JSON, it returns in plain text, only a value such as eg: 79.90
I need it to be this way, using arrayAmount[0]=
, because it is part of another function.
How do I adjust the script?