<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>Help with cross-platform javascript css
sniffer</title></head><body>
<div>Hello,</div>
<div><br></div>
<div>I was wondering if someone could point me to what I'm doing
wrong. I'm trying to put a javascript browser sniffer into the
pageHeader in the #prefs section, that will detect PC, Mac or ie3 and
load a separate stylesheet for each result. I have the script below in
the pageheader outline but can't get the css.files to be called up
properly. I keep getting the error:<font color="#000000"> Macro error:
Can't evaluate the expression because the name &quot;ie3&quot; hasn't
been defined.</font></div>
<div><br></div>
<div>There is probably a problem between the javascript and userscript
getting garbled. It looks as if frontier doesn't recognize my
stylesheets that I saved as outlines in the #styleSheets directory.
Any ideas?</div>
<div>Thanks, nate</div>
<div><br></div>
<div>&lt;html&gt;</div>
<div>&lt;head&gt;<br>
<x-tab>&nbsp; </x-tab>&lt;title&gt;{title}&lt;/title&gt;<br>
<x-tab>&nbsp; </x-tab><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>{metaTags
()}<br>
<x-tab>&nbsp;&nbsp; </x-tab>&lt;script&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>if
(navigator.appName == &quot;Microsoft Internet Explorer&quot;)&nbsp;
\{<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>if
(navigator.appVersion \&lt; 4)&nbsp; \{<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>document.write({linkStyleSheet (ie3)}<br>
<x-tab>&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>}<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>}<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>else
if (navigator.appVersion.indexOf(&quot;Mac&quot;) != -1) \{<br>
<x-tab>&nbsp; </x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>document.write({linkStyleSheet (mac)})<br>
<x-tab>&nbsp; </x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>}<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>else&nbsp; \{<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>document.write({linkStyleSheet (pc)})<br>
<x-tab>&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>}<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>&lt;/script&gt;<br>
&lt;/head&gt;<br>
{bodyTag ()}</div>
<div><br></div>
<div>When the page loads in a browser i get this in the source
code:</div>
<div><br></div>
<div><font color="#000000">&lt;</font><font
color="#0000FF">script</font><font color="#000000">&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>if
(navigator.appName == &quot;Microsoft Internet Explorer&quot;)&nbsp;
{<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>if
(navigator.appVersion &lt; 4)&nbsp; {</font></div>
<div><font
color="#000000"><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>document.write(&lt;</font><font color="#0000FF">b</font><font
color="#000000">&gt;[&lt;</font><font color="#0000FF">/b</font><font
color="#000000">&gt;Macro error: Can't evaluate the expression because
the name &quot;ie3&quot; hasn't been defined.&lt;</font><font
color="#0000FF">b</font><font color="#000000">&gt;]&lt;</font><font
color="#0000FF">/b</font><font color="#000000">&gt;</font></div>
<div><font
color="#000000"><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>}<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>}<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>else
if (navigator.appVersion.indexOf(&quot;Mac&quot;) != -1) {<br>
<x-tab>&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>document.write(&lt;</font><font color="#0000FF">b</font><font
color="#000000">&gt;[&lt;</font><font color="#0000FF">/b</font><font
color="#000000">&gt;Macro error: Can't evaluate the expression because
the name &quot;mac&quot; hasn't been defined.&lt;</font><font
color="#0000FF">b</font><font color="#000000">&gt;]&lt;</font><font
color="#0000FF">/b</font><font color="#000000">&gt;<br>
)<br>
<x-tab>&nbsp; </x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>}<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>else&nbsp; {<br>
<x-tab> </x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>document.write(&lt;</font><font color="#0000FF">b</font><font
color="#000000">&gt;[&lt;</font><font color="#0000FF">/b</font><font
color="#000000">&gt;Macro error: Can't link to style sheet &quot;:&quot;
because it wasn't found.&lt;</font><font
color="#0000FF">b</font><font color="#000000">&gt;]&lt;</font><font
color="#0000FF">/b</font><font color="#000000">&gt;<br>
)</font></div>
<div><font
color="#000000"><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>}</font></div>
<div><font color="#000000">&lt;</font><font
color="#0000FF">/script</font><font color="#000000">&gt;</font></div>
<div><br>
<br>
</div>
<div><tt>-- </tt></div>
<div>Nate Russell, Webmaster<br>
Inter-Research Science Publisher<br>
Nordbuente 23<br>
D-21385 Oldendorf/Luhe<br>
Germany<br>
<br>
Tel: (+49) (4132) 7127&nbsp;&nbsp;&nbsp;&nbsp; Email:
nate@int-res.com<br>
Fax: (+49) (4132) 8883&nbsp;&nbsp;&nbsp;&nbsp;
http://www.int-res.com</div>
</body>
</html>