I am having an odd problem in my onclick handler.
I am calling a javascript function "download" in the onclick of an . This has been in use on production websites for years. Recently, I get a strange javascript error when clicking the button in Firefox or Chrome (not a problem in IE8). Firefox says "TypeError: download is not a function" and Chrome says "TypeError: string is not a function".
HTML:
<a onclick="download('position','container','ids');return false;" href="#">Run download</a>
JS:
function download(position, container, ids) {
alert('in download');
}
You can see this demonstrated in this Fiddle.
Primarily, I would like to know WHY this doesn't work (other functions work fine). It looks like if I rename the function or use a button instead of a link, the problem will be solved as well, but deploying such a change will be a nightmare. If it is necessary, that's fine, but I want to know why the download function no longer works.