I have this button on my page, which points to the function download()
:
<a class="myButton" onclick='return download(this);'>Download</a>
download():
function download(button)
{
console.info(button);
return true;
}
After clicking the button I get:
Uncaught TypeError: download is not a function at HTMLAnchorElement.onclick (mbnet.html:1153)
However, If I open the developer console and execute download
then I get:
function download(button)
{
console.info(button);
return true;
}
If I execute download()
then I get:
undefined
true
So obviously the function is defined, why am I seeing this error? Is it because I render the button with fluid?
I also tried to wrap the function download()
with $(document).ready();
,
but this changed nothing.
$(document).ready(
function() {
function download(button)
{
console.info(button);
return true;
}
}
);