add debug mode and support lower version of jQuery
wrote test