정보

아이폰웹페이지 만들기-단말기별 링크 분기 방법

바람한톨 2011. 4. 11. 12:43


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
<meta name = "viewport" content = "initial-scale = 1.0">
 </head>

 <body>
 <script type="text/javascript">
  var currDate = new Date();
  var currTime = currDate.getHours();
  document.write("Current Date : " + currDate + "<br/>");
  if ((navigator.userAgent.indexOf('iPhone') != -1) ||  (navigator.userAgent.indexOf('iPod') != -1)) {
   document.location = "http://메롱/iphone.html";
  } else if((navigator.userAgent.indexOf('iPad') != -1)) {
   document.location = "http://메롱/ipad.html";
  }
 </script> 

 </body>
</html>