개발 Q&A

제목 ie 버전별 js 사용방법
글쓴이 앙마 작성시각 2014/08/22 10:16:10
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 12794   RSS
무엇을 하나 ie가 문제더군요ㅜㅡ

버전이 낮은 경우 사용이 안되는 게 많아서 

<!--[if IE]><p>You are using Internet Explorer.</p><![endif]-->
<![if !IE]><p>You are not using Internet Explorer.</p><![endif]>

<!--[if IE 7]><p>Welcome to Internet Explorer 7!</p><![endif]-->
<!--[if !(IE 7)]><p>You are not using version 7.</p><![endif]-->

<!--[if gte IE 7]><p>You are using IE 7 or greater.</p><![endif]-->
<!--[if (IE 5)]><p>You are using IE 5 (any version).</p><![endif]-->
<!--[if (gte IE 5.5)&(lt IE 7)]><p>You are using IE 5.5 or IE 6.</p><![endif]-->
<!--[if lt IE 5.5]><p>Please upgrade your version of Internet Explorer.</p><![endif]-->

<!--[if true]>You are using an <em>uplevel</em> browser.<![endif]-->
<![if false]>You are using a <em>downlevel</em> browser.<![endif]>

<!--[if true]><![if IE 7]><p>This nested comment is displayed in IE 7.</p><![endif]><![endif]-->

이것을 보고 js에도 적용이 되는지 테스트를 하고 있습니다


 <html>
      <head>
          <meta charset="utf-8" />
           <title>홍길동의 홈페이지</title>
      </head>
      <body>
           <h1>홍길동의 홈페이지에 오신 것을 환영합니다!</h1>
           <h2>인사의 글</h2>
           <!--[if (IE 11)]>
        <div>가나다라만바다</div>
           <![endif]-->
      </body>
<!--[if IE 7]>
    alert("ggg")
    <script src="test.js"></script>
    <![endif]-->
<!--[if IE 11]>
    alert("hhhh")
    <script src="test7.js"></script>
    <![endif]-->
 </html>

이런식으로 하는데 전혀 alert창이 뜨질 않네요;
 
 다음글 페이징 관련 질문드립니다. 적용해보려고 하는 중인데요 (1)
 이전글 다음 에디터나 ,네이버 스마트에디터 강의 혹 설명 잘되... (1)

댓글

델리카토 / 2014/08/22 19:34:46 / 추천 0
alert 사이에 스크립트가 없는데요?
letsgolee / 2014/08/23 10:12:36 / 추천 0
alert가 뜨지 않는게 정상 아닌가요? ㅎㅎ.

<!--[if LT IE 9]>
<script src="test7.js"></script>
<script>alert("ggg");</script>
<![endif]-->
<!--[if GTE IE 9]>
<script src="test.js"></script>
<script>alert("hhh");</script>
<![endif]-->