The DOM interfaces for manipulating web pages are not part of the ECMAScript standard, or of JavaScript itself. Officially, they are defined by a separate standardization effort by the W3C; in practice, browser implementations differ from the standards and from each other, and not all browsers execute JavaScript.
To deal with these differences, JavaScript authors can attempt to write standards-compliant code which will also be executed correctly by most browsers; failing that, they can write code that checks for the presence of certain browser features and behaves differently if they are not available.[17] In some cases, two browsers may both implement a feature but with different behavior, and authors may find it practical to detect what browser is running and change their script's behavior to match.[18][19] Programmers may also use libraries or toolkits which take browser differences into account.
Furthermore, scripts will not work for all users. For example, a user may:
- use an old or rare browser with incomplete or unusual DOM support,
- use a PDA or mobile phone browser which cannot execute JavaScript,
- have JavaScript execution disabled as a security precaution,
- or be visually or otherwise disabled and use a speech browser
To support these users, web authors can try to create pages which degrade gracefully on user agents (browsers) which do not support the page's JavaScript.
No comments:
Post a Comment