examples/chat.rb is not working

currently this demo is not working, this is because when $("form") bind "submit" event, the form tag is not in DOM yet. Need to move form before the binding(script tag).