I am building a demo movie app so I decided to assign onclick events with a function that gets me some movie related data.
The problem arises when I click on the target links I want to work on, giving me back an undefined function.
Here’s the code:
<li>
<a href="index.html" language-id=${idLanguage} onclick="getMovieList(with_original_language=${idLanguage},${language} )">${language}</a>
</li>
When I inspect my links they do have the given arguments but if I click on them, then it says my function is undefined so I cannot get the values back.
Why is that ?
I tried the method window.onload expecting to load the function beforehand and get it as defined,but still it did not work.