I have a lot of scripts on my page:
Example:
<script>
window.addEvent('Updated', function(data) {
/*I'm using a mootools javascript framework and my string below contain an error:
Uncaught TypeError: Cannot call method 'empty' of null*/
var container = document.getElement('cart_contents_data');
container.empty();
});
</script>
This error break all other code (script blocks). I'm looking for the way to isolate script blocks (each other).
I'm tried something like this:
<script>
try {
window.addEvent('Updated', function(data) {
/*I'm using a mootools javascript framework and my string below contain an error:
Uncaught TypeError: Cannot call method 'empty' of null*/
var container = document.getElement('cart_contents_data');
container.empty();
});
} catch(err) {console.log(err)}
</script>
But this solution doesn't help me. Thanks.