Answer the question
In order to leave comments, you need to log in
How to create an array from the data received from multiple $.getJSON() for further use in a jQuery script?
hello world!
Is it possible to do this in jQuery? Here is the starting script: jsfiddle.net/gumuptfb/8
In it I get the data of the sharing counter from the VK, FB and Twitter APIs and round them up (with the addition of k
and M
if they are outside the specified limits). I would like to write these received numbers to an array (or some global variable) before rounding them up , in order to use them later (in another place in the script). For example, to calculate the sum and construct the output condition for another piece of code.
Yes, you can withdraw the amount if you just take what is in and span.vk
add up (span.fb
span.tw
var d = a + b + c
). The problem is that if the received value is greater than 999, then the rounding function will be applied to it and the sum cannot be obtained in this way.
Help me please.
Answer the question
In order to leave comments, you need to log in
You have everything right, actually done, you just use (output to the console) the total array before it is filled.
How can I make a function run only after another one has completed?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question