Log in Ajax call and html logic