I'm hoping someone can explain this and give a tip what I'm doing wrong.
This doesn't work (simplified for readability):
<style type="text/css">
<SCRIPT TYPE='text/javascript' LANGUAGE='JavaScript'>
if ( navigator.platform.substring(0,3).toLowerCase() == 'win')
document.write('body { font-family: Arial} ')
else document.write('body {font-family: Gadget } ')
</SCRIPT>
</style>
But this does:
<SCRIPT TYPE='text/javascript' LANGUAGE='JavaScript'>
if ( navigator.platform.substring(0,3).toLowerCase() == 'win')
document.write('<style type="text/css"> \n' +
'body{ font-family: Arial} \n' +
'</style>')
else document.write('<style type="text/css"> \n' +
'body { font-family: Gadget } \n' +
'</style>')
</SCRIPT>
I've tried to write style text common to both if/else's in the HTML but it
won't work. Why is this? Does JS act differently inside the style tags?
-- Gnarlie
http://www.Gnarlodious.com