Sorry, that title probably doesn’t make much sense, but what I want to know is the difference between:
window.myfunc = function(){}
and
function myfunc(){}
With jsfiddle, the functions only seem to work when attached to window. I’m assuming this is something to do with how it’s set up to read the javascript and html separately, but that there is otherwise no difference?
The first one garanties you the function is global and will available everywhere.
The second one does the same. but the second one will take the scope of the first function that embed it.
first case:
second case
i hope this makes sense now to you