---
title: "js判断手机系统类型"
author: "suko"
date: "2015-09-21T13:52:29Z"
tags: []
categories: ["移动开发"]
slug: "js"
draft: false
lastmod: "2015-09-21T13:53:15Z"
id: 2244979
url: "https://suko.iteye.com/blog/2244979"
---

```java

function checkOSType(){
        var ua = navigator.userAgent.toLowerCase();	
		if (/iphone|ipad|ipod/.test(ua)) {
		        alert("iphone");
		} else if (/android/.test(ua)) {
			alert("android");
		}
	}

```