In drupal 6, I've written a module that outputs some html which I am displaying in a block using hook_block.
There is a js file that I want to load only when that block loads so I am drupal_add_js() inside hook_block.
It is all working except for this problem: when you refresh the page (regardless of whether you clear caches at the same time), often an old version of the script gets loaded. Newer and older versions turn up on a seemingly random basis.
What can I do to ensure that the correct version is loaded? Thanks.
Edit: One of the stylesheets that I'm loading via the theme's .info file is doing the same thing - random versions of it are loading. So it looks like a general problem not module or block related.