Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript differences between Mobile Safari and Safari on Mac?

Hey this question is pretty general, but I'm wondering what the Javascript differences are in Mobile Safari and Safari for Mac.

I was under the impression that from a Javascript perspective they are the same, with only some differences in CSS/rendering. But I am experiencing a number of Javascript errors in Mobile Safari that don't exist in regular Safari on Mac.

Basically a number of calls to certain jQuery plugins are returning undefined values (according to the developer debugger in Mobile Safari).

The website that I'm experiencing these issues on has a very lousy front end that is riddled with validation errors, lousy JS and has an enormous amount of CSS attached. I have no doubt that this issue lies somewhere in this code, and I've never experienced issues like this before.

I'm just having trouble honing in on the problem, so any insight/links as to the general differences in Javascript engines would be much appreciated.

like image 687
Jon Raasch Avatar asked Jul 08 '10 17:07

Jon Raasch


1 Answers

Javascript itself, the core language, is no different. There are a few significant differences in the DOM that appear undocumented, but mostly it is all the same. Here you can see some differences in events that you can handle.

The DOM differences I noticed had to do with measuring elements. For example getClientRects, at least for a Selection or Range, was not available. There are probably other things.

like image 109
drawnonward Avatar answered Oct 18 '22 18:10

drawnonward