Simple object that you pass messages to and it logs them and writes the to the console or alerts them.
It can also send client side javascript errors to the server so you can keep a track of problem areas
or catch content related issues in testing before a site goes live.
download form sourceforge.net
I use this in two ways, one, to write general messages and debug info to the console (moz and opera) or alert (IE) and two, to do the same with errors, though with errors you have the option of saving them to the server.
<script type="text/javascript">
function somefuction(){
if (window.logger){logger.log('hello message from somefunction')}
try {
// some thing that might error
} catch(e){
if (window.logger){logger.error(e,'extra message at this stage')}
}
}
</script>
If you want to save javascript errors to the server you'll need to build something to store them.
text
text