Changed deprecated jQuery function and changed the way to check for a content existence

Fixes #144