What's the difference between preventDefault() and stopPropagation()

preventDefault prevents the default action that was intended to occur. If you click a button, preventDefault() will stop the button from firing any events, such as a form submit. Use preventDefault() if you want to stop your form from being submitted:

<button id='myform_button'>Submit</button>
<script>
$("#myform_button").click(function(e){
   if ( formIsNotValid() )
   {
      e.preventDefault();
      return false;
   }
   else
   {
      $("#myform").submit();
   }
});
</script>

stopPropagation does the same thing as prefentDefault(), but it also stops the event from bubbling up the event chain. If you have your button inside a div which also has a click event, preventDefault() will only stop the form from submitting. But the click handler for the wrapper will still fire. If you want to shut down everyting, you have to use stopPropagation().

How to fight patent trolls

If you haven't heard about it yet, checkout Ask Patents, a site dedicated to taking the war to the doorstep of patent trolls.

According to Joel Spolsky, software patents are ludicrously easy to file, and ludicrously broad in their cope.

Since patent examiners rely so much on keyword searches, when you submit your application, if you can change some of the keywords in your patent to be different than the words used everywhere else, you might get your patent through even when there’s blatant prior art, because by using weird, made-up words for things, you’ve made that prior art harder to find.

... Have you ever seen a patent application that appears ridiculously broad? (“Good lord, they’re trying to patent CARS!”). Here’s why. The applicant is deliberately overreaching, that is, striving to get the broadest possible patent knowing that the worst thing that can happen is that the patent examiner whittles their claims down to what they were entitled to patent anyway.

Thus, we have Stack Exchange stepping forward with Ask Patents, which presents patent applications that are likely bullshit. If you, as the reader, can find examples of prior art (prior examples of the technology in application), then you can upload the example to the site, and it can be used by the patent office to deny the patent claim.

Check it out. It's easier than you might think. The very first patent I looked at was a blatant attempt to patent ecommerce. Anyone with a shopping cart system would be at risk if this patent was accepted.