Is it possible to use conditional comments from within a Chrome Frame?

后端 未结 1 1068
情歌与酒
情歌与酒 2021-01-25 16:47

When using...


.ie8-7-6 .loginForm {display:none;} /* The login form is hidden. */
         


        
1条回答
  •  囚心锁ツ
    2021-01-25 17:25

    The best way to detect that you're in Chrome Frame inside IE is checking for

    var isChromeFrame = !!window.externalHost;
    

    This is only available inside Chrome Frame. Currently there are no conditional comments-like construct for Chrome Frame.

    More at http://www.chromium.org/developers/how-tos/chrome-frame-getting-started/understanding-chrome-frame-user-agent.

    But to your situation, if the user has Chrome Frame installed already and you're triggering it via a chrome=1 flag, then they'll never see any content inside of IE conditional comments.

    0 讨论(0)
提交回复
热议问题