I've seen this done a few times and just wondered what the purpose was:
Is JS capable of viewing the query string that was used in its own src attribute? Or is that "1234" doing something else?
Probably to prevent caching on the browser especially if the JS contains a dynamic JSON or similar data...especially IE which sometimes yields an unexpected if values get was from a cache JS.
Like modtup says, it's usually used to influence caching in the browser.
Another use is that if the file is parsed by a server-side language (such as PHP), then the parameter will be available in $_GET.
$value = $_GET['val'];