Script for targeting platforms (not browsers)
-
I can’t seem to get a straight answer for this, not sure what I’m doing wrong, but have been searching for a solution for over a month.
I need to call separate stylesheets, pending on the platform (not browser). I have a script I’ve found that’s supposed to do that, but it’s not working.
The site is fish-fry.com/dev
the script, which I’ve placed in my head is:
<script type="text/javascript"> /*********************************************** * Different CSS depending on OS (mac/pc)- © Dynamic Drive (www.dynamicdrive.com) * This notice must stay intact for use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/ var csstype="external" //Specify type of CSS to use. "Inline" or "external" var mac_externalcss='http://www.fish-fry.com/dev/wp-content/themes/FISH-FRY-MUSIC-AND-SOUND-CUSTOM-THEME/style.css' //if "external", specify Mac css file here var pc_externalcss='http://www.fish-fry.com/dev/wp-content/themes/FISH-FRY-MUSIC-AND-SOUND-CUSTOM-THEME/style-windows.css' //if "external", specify PC/default css file here ///////No need to edit beyond here//////////// var mactest=navigator.userAgent.indexOf("Mac")!=-1 if (csstype=="inline"){ document.write('<style type="text/css">') if (mactest) document.write(mac_css) else document.write(pc_css) document.write('</style>') } else if (csstype=="external") document.write('<link rel="stylesheet" type="text/css" href="'+ (mactest? mac_externalcss : pc_externalcss) +'">') </script>Any help is greatly appreciated!
[ Duplicate http://wordpress.org/support/topic/radical-difference-between-mac-and-pc?replies=16 closing. Please keep to the original thread for this topic. ]
The topic ‘Script for targeting platforms (not browsers)’ is closed to new replies.