0

何が間違っているのかわかりませんが、1か月以上解決策を探していました。

プラットフォーム (ブラウザーではなく) で保留中の個別のスタイルシートを呼び出す必要があります。それを行うはずのスクリプトを見つけましたが、機能していません。

サイトはfish-fry.com/devです

私が頭に置いたスクリプトは次のとおりです。

<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>
4

1 に答える 1

0

まず、 jslint.comからそのスクリプトを実行します。
かなりのフォーマットエラーがあるようです。

これもチェックしてください。
おそらく、ユーザーエージェントはチェックする場所ではありませんか?

:ナビゲーター。appVersion .indexOf("勝利")

于 2012-05-27T00:02:41.420 に答える