Ask coding questions

← Back to all posts
Why is my function undefined?
RixTheTyrunt (3)

It writes, that SOMEHOW the function sendComment is not defined... Could somebody define it?

Comments
hotnewtop
Coder100 (19277)

You have another error on line 9:

see it? the correct one is:

xfinnbar (211)

Move the function out of window.onload. onclick can only using functions in the global scope. Variables (and therefore functions) defined inside functions are put in the scope of the function, so you can avoid name collisions.

RixTheTyrunt (3)

Now the variables ( Just a piece of a screenshot )