So i have a webpart where some very smart people have hardcoded the number of items to show... So i've insert some javascript in a script editor to show more items (since those smart people just add "style= display: none" on the items 3 and above... ). But my problem is that the script isn't executed everytime, sometimes i have to refresh the page to make it work. And i wait for the document to be fully loaded before doing my stuff... here's what my code looks like:
<script>
$(window).load(function(){
$(".Merck_OrgLocUpcomingEvents_wrapper").each(function(){
$(this).find("li").each(function(){
$(this).attr("style", " ");});
});
});
</script>
So this works but not everytime. I don't know why, isn't it because of cache? How can i fix it and make it work everytime i load the page? I can't edit the webpar's code.