Callback context

I should have said, that having to use a global variable is messy, but in JavaScript I don’t know how else to do it.