$def with ()

<html>
	<head>
		<title>mainHeader</title>
		<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
		<style>
			#header{
				height:300px;
				overflow:scroll;
			}

		</style>
	</head>

	<body>
		<script>
		function checkForMessage(){
            jQuery.ajax({
                    url:"/bet",
                    type: "POST",
                    data: {action: "check"},
                    success: function(data) {
                        if(data){
                            jQuery("#header").html(data)
                            var element = document.getElementById("header");
        					element.scrollTop = element.scrollHeight;
                        }else{
                            jQuery("#header").html("I AM SENDING IN A SINGLE BET")
                        }
                    }
                    });
        }
		function sendMessage(){
            jQuery.ajax({
                    url:"/bet",
                    type: "POST",
                    data: {action: "send",message :jQuery("#message").val()},
                    success: function(data) {             
    					jQuery("#message").val('')
                    }
                    });
        }
        setInterval(checkForMessage,500);
		</script>
		<div id="header"> PROPOSE OR TAKE A BET</div>
		<input type='text' rows='10',cols='50' id='message'></input>
		<button type="button" onclick="sendMessage()">Send Message</button>
	</body>
</html>
