Add jQuery reference in usage and reuse duplicate code

Hi. Here is what I did:
1. I added jQuery reference in README, so we can directly copy the usage code and run it
2. Reuse duplicate code