The benefit to javascript links is it makes it easier for the merchant to push rotating or updated offers without the affiliate having to change links. It also hides your affiliate links from search engines (which don't like them) and certain security software (which blocks them) and makes them less prone to cookie blocking.
Disadvantages: You can't use them in email, they bloat your page load times, and as Whitebark mentioned, some people block Javascript in their browsers (so does some software). If you use Javascript links you should ideally have a "noscript" tag for each one, which is a pain. They are difficult to impossible to integrate into click tracking software too.