One of the reasons you might be getting this error is because you are trying to use the client object model without the sp.js file being loaded.
Other post regarding errors you might be getting related to the client object model and sp.js
You might need the ExecuteOrDelayUntilScriptLoaded method
Uncaught TypeError: Cannot read property ‘get_current’ of undefined
SP.ClientContext.get_current is null or not an object
