Added support for jQuery library
The whole thing did not work if no redirect page was set