js compatibility issue with ipad