Try:
<script>
App.validate(helper, form, "", // Simple request to the server
function(data) {
if (data.products_in_cart) {
window.fireEvent('validateEvent', {cart:data});
}
},'POST'
);
</script>
and the other file:
<script>
var handler = document.id('html');
handler.addEvent('validateEvent', function(data){
handler.set('html', JSON.stringify(data));
});
</script>