6 | Part of the jsMath package for mathematics on the web.
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 serving the page that is using jsMath.
12 | ---------------------------------------------------------------------
14 | Copyright 2004-2006 by Davide P. Cervone
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
20 | http://www.apache.org/licenses/LICENSE-2.0
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.
33 while (!window.jsMath && !showWarning) {
35 window.jsMath = window.parent.jsMath;
36 if (!window.jsMath) {throw "no jsMath";}
38 showWarning = 1; pageDomain = '';
39 try {pageDomain = document.domain} catch (err) {}
41 // MSIE on Mac can't change document.domain, and 'try' won't
42 // catch the error (Grrr!) so don't even attempt it.
44 if (pageDomain.match(/\..*\./) &&
45 (navigator.appName != 'Microsoft Internet Explorer' ||
46 !navigator.platform.match(/Mac/) || !navigator.userProfile || !document.all)) {
48 document.domain = pageDomain.replace(/^[^.]*\./,'');
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."
63 isOmniWeb4 = (document.readyState == 'loading' &&
64 navigator.accentColorName != null &&
65 navigator.omniWebString == null);
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;
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>');
78 jsMath.Script.Start();
79 document.writeln('<script src="'+url+'"><'+'/script>');
85 if (window.jsMath && !isOmniWeb4) {
87 jsMath.Script.endLoad();