os마다 다른 웹 문서 띄우기 > 웹프로그래밍

본문 바로가기

웹프로그래밍

웹프로그래밍

6. os마다 다른 웹 문서 띄우기

페이지 정보

작성자 관리자 댓글 1건 조회 2,991회 작성일 21-08-03 21:16

본문

6. os마다 다른 웹 문서 띄우기

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, 

user-scalable=0;">

<title>device check</title>

<link rel="stylesheet" href="css/default.css" />

<style>

body {

 font-size: 16px;

}

</style>

<script language="javascript">

function checkBrowser(){

 if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))){

 location.href="main06.html";

 }else if(navigator.userAgent.match(/Android/i)){

 location.href="main05.html";

 }else{

 location.href="main04.html";

 }

}

// document.write("User-agent header sent : "+navigator.userAgent);

// window.onload=checkBrowser;

if(window.addEventListener){

 window.addEventListener("load", checkBrowser, false);

}else{

 window.attachEvent("onload", checkBrowser);

}

// window.addEventListener("load", checkBrowser, false);

</script>

</head>

<body>

</body>

</html>


Copyright © LEELAB.CO.KR. All rights reserved.