fix javascript for ipad