implementing offline behaviour for jquery posts