I have use a service to count the total of the require objects, and it returns and store in the localStorage item called "total"
When the service success, I do the mapping and run the JS code:
codevar carousel = jQuery('[name="mobilecarousel_24"]');
var total = localStorage.getItem("total");
var require = Math.ceil(total/5);
carousel.carousel("add", require);
Appery( 'mobilecarousel_24' ).refresh();/code
Refresh Exception: cannot call methods on carousel prior to initialization; attempted to call method 'refresh'(Even I didn't put the refresh code);
After I put the refresh code, it appears another error:
carousel refresh
I think there is something wrong in my code or I need the parameters...