my code
ho w to assign data-percent value dynamically with using jquery and Ajax calls.
i am write one web method. in my method take arguments and return value, how to assign the return value to data-percentage.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suraj SahooRank #382 · 6.6K reputationPosted Mar 9, 2015, 2:17 AM EDT
$(document).ready(function () {
$.ajax(function(){
url:"URL TO GET THE VALUE %",
type:"GET",
success: function(data) { //Return the list of %age values and assign like below
RenderPieChart('container', [
['Firefox', data[0]],
['IE', data[1]],
['Chrome', data[2]]
]);
}
});
I hope this helps.
Accept if helps anyway.
Thanks
VEERENDRA kUMAR185 reputationPosted Mar 9, 2015, 2:34 AM EDT
i am using same way.
i want how to bind the value for data-percentage.
i am calling web method through ajax call. i get result. now how to bind.
Suraj SahooRank #382 · 6.6K reputationPosted Mar 9, 2015, 4:11 AM EDT
I think using the dynamic variable which has the data percentage can be used directly in the ajax success. Like FireFox[name, dynamicVariable]
Hope this works