웹프로그래밍

본문 바로가기
사이트 내 전체검색


웹프로그래밍
웹프로그래밍

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

페이지 정보

작성자 관리자 댓글 0건 조회 698회 작성일 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>

댓글목록

등록된 댓글이 없습니다.


개인정보취급방침 서비스이용약관 모바일 버전으로 보기 상단으로

TEL. 063-469-4551 FAX. 063-469-4560 전북 군산시 대학로 558
군산대학교 컴퓨터정보공학과

Copyright © www.leelab.co.kr. All rights reserved.