File:
[LON-CAPA] /
loncom /
html /
adm /
jsMath /
jsMath-loader.html
Revision
1.2:
download - view:
text,
annotated -
select for diffs
Wed May 17 22:19:27 2006 UTC (18 years, 3 months ago) by
albertel
Branches:
MAIN
CVS tags:
version_2_5_X,
version_2_5_2,
version_2_5_1,
version_2_5_0,
version_2_4_X,
version_2_4_99_0,
version_2_4_2,
version_2_4_1,
version_2_4_0,
version_2_3_X,
version_2_3_99_0,
version_2_3_2,
version_2_3_1,
version_2_3_0,
version_2_2_X,
version_2_2_99_1,
version_2_2_99_0,
version_2_2_2,
version_2_2_1,
version_2_2_0,
version_2_1_X,
version_2_1_99_3,
version_2_1_99_2,
version_2_1_99_1,
version_2_1_99_0,
HEAD
- jsmath 3.3
1: <html>
2: <head>
3: <!--
4: | jsMath-loader.html
5: |
6: | Part of the jsMath package for mathematics on the web.
7: |
8: | This file is used for jsMath components when the browser doesn't
9: | handle the XmlHttpRequest function, or when they must be obtained
10: | from a server other than the one server the page that is using jsMath.
11: |
12: | ---------------------------------------------------------------------
13: |
14: | Copyright 2004-2006 by Davide P. Cervone
15: |
16: | Licensed under the Apache License, Version 2.0 (the "License");
17: | you may not use this file except in compliance with the License.
18: | You may obtain a copy of the License at
19: |
20: | http://www.apache.org/licenses/LICENSE-2.0
21: |
22: | Unless required by applicable law or agreed to in writing, software
23: | distributed under the License is distributed on an "AS IS" BASIS,
24: | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25: | See the License for the specific language governing permissions and
26: | limitations under the License.
27: -->
28: </head>
29: <body>
30:
31: <script>
32: var showWarning = 0;
33: while (!window.jsMath && !showWarning) {
34: try {
35: window.jsMath = window.parent.jsMath;
36: if (!window.jsMath) {throw "no jsMath";}
37: } catch (err) {
38: showWarning = 1; pageDomain = '';
39: try {pageDomain = document.domain} catch (err) {}
40: //
41: // MSIE on Mac can't change document.domain, and 'try' won't
42: // catch the error (Grrr!) so don't even attempt it.
43: //
44: if (pageDomain.match(/\..*\./) &&
45: (navigator.appName != 'Microsoft Internet Explorer' ||
46: navigator.platform != 'MacPPC' || !navigator.userProfile || !document.all)) {
47: try {
48: document.domain = pageDomain.replace(/^[^.]*\./,'');
49: showWarning = 0;
50: } catch(err) {}
51: }
52: }
53: }
54:
55: function Warning () {
56: alert(
57: "jsMath can't load one of its required components, because jsMath " +
58: "was not obtained from a server that is in the same domain as the " +
59: "page that loaded it."
60: );
61: }
62:
63: isOmniWeb4 = (document.readyState == 'loading' &&
64: navigator.accentColorName != null &&
65: navigator.omniWebString == null);
66:
67: if (showWarning) {setTimeout("Warning()",1)} else {
68: debug = window.parent.debug; show = window.parent.show;
69: jsMath.Script.window = window; url = jsMath.Script.url;
70: if (isOmniWeb4) {
71: if (url != jsMath.Script.prevURL) {
72: jsMath.Script.prevURL = url;
73: document.writeln('<script src="'+jsMath.root+'jsMath-loader-omniweb4.js"><'+'/script>');
74: document.writeln('<script src="'+url+'"><'+'/script>');
75: document.writeln('<script src="'+jsMath.root+'jsMath-loader-omniweb4.js"><'+'/script>');
76: }
77: } else {
78: jsMath.Script.Start();
79: document.writeln('<script src="'+url+'"><'+'/script>');
80: }
81: }
82: </script>
83:
84: <script>
85: if (window.jsMath && !isOmniWeb4) {
86: jsMath.Script.End();
87: jsMath.Script.endLoad();
88: }
89: </script>
90:
91: </body>
92: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>