Eagles beat Cowboys 24-22