---
title: "判断是否来自手机移动端的访问，并跳转（原）"
author: "eoasis"
date: "2011-10-31T11:48:13Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2011-10-31T11:48:13Z"
id: 1224183
url: "https://eoasis.iteye.com/blog/1224183"
---

```
var browserName_ = navigator.userAgent ;
	if(browserName_.indexOf("iPad")<0&&browserName_.indexOf("Windows NT")<0&&browserName_.indexOf("Macintosh")<0){
			if(browserName_.indexOf("Linux")>0){
				if(browserName_.indexOf("Mobile")>0||browserName_.indexOf("U;")>0){
					 location.href="http://xxx.xxx.com/";
				}
			}
			else{
				location.href="http://xxx.xxx.com/";
			}
	}  
```