Posts

Showing posts with the label jstl-functions

jstl c:set is not working on js code in jsp file

jstl c:set is not working on js code in jsp file I have a JSON from a service. I am appending a html block by JSON value and I have to check some values for appropriate display. I am trying to set discountValue variable but it not working with js variable. How can I solve it? if (data!="") { $.each(data,function(index,element){ var intDiscount=parseInt(10); console.log("intDiscount::"+intDiscount); var strIndex=''; strIndex+='<div class="card">'; strIndex+='<c:set var="discountValue" value="'+intDiscount+'"/>'; console.log("${discountValue}"); ... ... ... ... } $('#visilabs-FavouriteCategoryTopSeller').append(strIndex); Console log: intDiscount::10 0 ...