added a jQuery closure, preventDefault, and c++ snippet.