Prevent: Error: Uncaught TypeError

Prevent: Error: Uncaught TypeError: object is not a function