Fixes the problem where the same request was sent multiple times to the
server. This was because jQuery('class').click() doesn't overwrite the
old click but seems to add the new one to an array. It now only adds the
click function if it doesn't exist already.