手机电脑访问跳转代码(手机电脑访问跳转代码是什么)
admin 发布:2022-12-19 15:57 114
本篇文章给大家谈谈手机电脑访问跳转代码,以及手机电脑访问跳转代码是什么对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:
网站自动识别手机电脑访问并自动跳转的代码谁给个
移动网站pc端和移动端官网并存。让访问pc端的官网直接跳转到移动端的网站代码:
SCRIPT LANGUAGE="JavaScript"
function mobile_device_detect(url)
{
var thisOS=navigator.platform;
var os=new Array("iPhone","iPod","iPad","android","Nokia","SymbianOS","Symbian","Windows Phone","Phone","Linux armv71","MAUI","UNTRUSTED/1.0","Windows CE","BlackBerry","IEMobile");
for(var i=0;ios.length;i++)
{
if(thisOS.match(os[i]))
{
window.location=url;
}
}//因为相当部分的手机系统不知道信息,这里是做临时性特殊辨认
if(navigator.platform.indexOf('iPad') != -1)
{
window.location=url;
}
//做这一部分是因为Android手机的内核也是Linux
//但是navigator.platform显示信息不尽相同情况繁多,因此从浏览器下手,即用navigator.appVersion信息做判断
var check = navigator.appVersion;
if( check.match(/linux/i) )
{
//X11是UC浏览器的平台 ,如果有其他特殊浏览器也可以附加上条件
if(check.match(/mobile/i) || check.match(/X11/i))
{
window.location=url;
}
}
//类in_array函数
Array.prototype.in_array = function(e)
{
for(i=0;ithis.length;i++)
{
if(this[i] == e)
return true;
}
return false;
}
}
mobile_device_detect("");
/SCRIPT
备注://里面的地址填的就是移动端的地址呦。
写一个asp浏览器识别,苹果,安卓,电脑跳转访问代码
HTTP_ACCEPT=Request.ServerVariables("HTTP_ACCEPT") '获取浏览器信息
HTTP_USER_AGENT=LCase(Request.ServerVariables("HTTP_USER_AGENT")) '获取AGENT
HTTP_X_WAP_PROFILE=Request.ServerVariables("HTTP_X_WAP_PROFILE") 'WAP特定信息 品牌机自带浏览器都会有
HTTP_UA_OS=Request.ServerVariables("HTTP_UA_OS") '手机系统 电脑为空
HTTP_VIA=LCase(Request.ServerVariables("HTTP_VIA")) '网关信息
Dim WapStr
WAPstr=False
If ubound(split(HTTP_ACCEPT,"vnd.wap"))0 Then WAPstr=True
If HTTP_USER_AGENT="" Then WAPstr=True
If HTTP_X_WAP_PROFILE"" Then WAPstr=True
If HTTP_UA_OS"" Then WAPstr=True
IF ubound(split(HTTP_VIA,"wap"))0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"netfront"))0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"iphone"))0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"opera mini"))0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"ucweb"))0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"windows ce"))0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"symbianos"))0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"java"))0 Then WAPstr=True
IF ubound(split(HTTP_USER_AGENT,"android"))0 Then WAPstr=True
If WAPstr=True Then
Response.Write "请访问手机版本"
response.redirect ""
response.end
else
'response.redirect ""
'response.end
End if
html手机跳转代码
scriptif(navigator.platform.indexOf('
Win32
')!=-1){}else{window.location.href="/c.html";}
/script
判断手机跳转,如果手机访问自动跳转到wap如果电脑方式
执行以下页面,如果跳转到另一个页面,那么加一个无条件跳转
meta
http-equiv="refresh"
content="0.1;url=b.html"
手机电脑访问跳转代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于手机电脑访问跳转代码是什么、手机电脑访问跳转代码的信息别忘了在本站进行查找喔。
版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;
相关推荐
- 05-19seo教程网,seo教程是什么
- 05-19竞价推广代运营,竞价推广代运营是什么意思
- 05-19seo推广是什么意思呢,seo推广是什么工作
- 05-19seo网站,seo网站是什么意思
- 05-19seo优化是什么,SEO优化是什么意思
- 05-18seo网站优化,seo网站优化是做什么的
- 05-18seo是什么职业,seo是做什么的?
- 05-18seo优化是什么意思,seo是什么意思
- 05-18sem优化,sem优化师是做什么的
- 05-18网站建设是干嘛的,网站建设是什么工作
取消回复欢迎 你 发表评论:
- 标签列表
- 最近发表
- 友情链接