Difference between revisions of "Jmol Applet/Browser Support"
AngelHerraez (talk | contribs) (Documenting browser support (JmolApplet and Jmol.js)) |
AngelHerraez (talk | contribs) |
||
Line 12: | Line 12: | ||
"isBrowserCompliant" works basically in this way: | "isBrowserCompliant" works basically in this way: | ||
− | * If | + | * If "document.getElementById" exists, then "isBrowserCompliant" passes. |
* Exceptions: | * Exceptions: | ||
− | ** Linux/Unix Konqueror | + | ** Linux/Unix Konqueror â¤3.3 |
− | ** Mac Opera | + | ** Mac Opera â¤7.54 |
** Mac Internet Explorer | ** Mac Internet Explorer | ||
− | ** Mac Safari | + | ** Mac Safari â¤1.2 (Webkit version â¤125.12) |
+ | ** Mac Mozilla with Java â¤1.4.2 | ||
Caveats: | Caveats: | ||
− | * Detection is based on [[:en:Browser Sniffing|browser sniffing]], which is in general terms a method not recommended to adapt web content to browsers. The rationale is probably that some specific browsers proved not to be compatible with Jmol. | + | * Detection is mostly based on [[:en:Browser Sniffing|browser sniffing]], which is in general terms a method not recommended to adapt web content to browsers. The rationale is probably that some specific browsers proved not to be compatible with Jmol, and that was the best way to detect them. |
* Some (recent) browsers are therefore not being taken care of. (e.g. Safari in Windows, Chrome) | * Some (recent) browsers are therefore not being taken care of. (e.g. Safari in Windows, Chrome) | ||
Revision as of 20:27, 30 November 2010
Browser support for the Jmol applet using Jmol.js
This page tries to explain and document what the Jmol.js javascript library is doing to insert applets depending on the user's browser. It will hoepfully lead to discussion about future implementation.
According to Jmol version 12.0.21.
Jmol.js runs some tests to anticipate browser compatibility and to decide how to insert the Jmol applet in the pages.
Browser compatibility
The "isFullyCompliant" test includes both "isBrowserCompliant" and "isJavaCompliant".
"isJavaCompliant" just checks if "navigator.javaEnabled()" returns true or false.
"isBrowserCompliant" works basically in this way:
- If "document.getElementById" exists, then "isBrowserCompliant" passes.
- Exceptions:
- Linux/Unix Konqueror â¤3.3
- Mac Opera â¤7.54
- Mac Internet Explorer
- Mac Safari â¤1.2 (Webkit version â¤125.12)
- Mac Mozilla with Java â¤1.4.2
Caveats:
- Detection is mostly based on browser sniffing, which is in general terms a method not recommended to adapt web content to browsers. The rationale is probably that some specific browsers proved not to be compatible with Jmol, and that was the best way to detect them.
- Some (recent) browsers are therefore not being taken care of. (e.g. Safari in Windows, Chrome)
HTML tag for the applet
The history of inserting Java applets in pages is long and complex, and there has been permanent debate over methods, standards and actual practice. Details will not be given here.
In summary, there are 3 ways an applet can be inserted into an html page:
- Use an
<applet>
tag. - Use an
<object>
tag adequate for MS Internet Explorer. - Use an
<object>
tag adequate for other browsers.