Skip to main content

ChargeOver is not defined

There are some scenarios (in particular pop-up windows loaded by jQuery) where browsers may try to execute Javascript prior to the browser fully loading and executing preceding <script> tags.

If you encounter this error:

Uncaught ReferenceError: ChargeOver is not defined

You should first check to make sure you are loading the ChargeOver libraries using the setup code provided for your account.

If you're sure that much is correct, surround your ChargeOver code with the block of loader Javascript shown at the right. This delays the execution of ChargeOver code until all required ChargeOver libraries have been initialized.

<!-- Use the setup code from your own account... -->
<script src="https://assets.chargeover.com/minify/?g=chargeover.js"></script>
<script>
// Use these next two lines to delay execution of the ChargeOver code until the libraries are loaded
function co_r(f){if(typeof(ChargeOver) == 'object'){f();}else{setTimeout('co_r('+f+')',250);}}
co_r(function(){

// Use the instance and token values from your account here
ChargeOver.Core.setup({
'instance': 'your-instance.chargeover.com',
'token': 'T08PvhDNLzsgW7uxl3UOm2ikCbVa1IYM'
});

// Put the rest of your calls to ChargeOver code here
// ... your code here ...

});
</script>