move the form tag before script tag

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.
Merge pull request #663 from loveky/master

examples/chat.rb is not working