简体   繁体   中英

Are JavaScript getters/setters supported by Mobile Safari on the iPad?

I'm developing an iPad Web App for a client. Unfortunately I don't have an iPad to test the app, so I tried testing it on my iPhone. I entered the following URL in Mobile Safari and it alerted me that the method is undefined:

javascript:alert(Object.defineProperty);

I need to know however if it'll work on the iPad. Additional information about getter/setter support on the iPad is appreciated.

I've only tested 4.3, but it looks like it is supported for JS objects, but not DOM objects... just to be different from IE8 which is the opposite.

If you have access to OSX, I recommend downloading XCode --it comes with a useful iOS emulator for the various devices.

Also, this link might be useful, as it contains a table of ECMAScript 5 features, even though it does not mention the DOM restriction.

http://davidbcalhoun.com/2011/new-mobile-safari-stuff-in-ios5-position-fixed-overflow-scroll-new-input-type-support-web-workers-ecmascript-5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM