I have a table with a dynamic number of sliders, for which I'd need to execute some javascript code for each cell of the table, when the page is loaded. Each slider needs a separate $(window).load(function(){... call.
Problem is: I only know the id and parameters at the time the slider is printed to the html, so I cannot add them all in the headers. This ends me up with stuff like
<td>
<script type="text/javascript">
$(window).load(function(){$("#my_id").PPSlider({ARGUMENTS});};
</script>
<input type="hidden" id="my_id"/>
</td>
Is there a way to replace this with an onload attribute of input? I have tried a dozen ways and they all don't seem to work. If not, how should this be done properly, given that I cannot incorporate them in the header?
EDIT: clarification: the arguments are different for each slider, they represent text to be shown when the slider is in certain positions.