在asp.net中,我想基于设备(桌面,平板电脑,移动设备)加载样式表和java脚本以及j查询。
基于设备我想要交换样式表和java脚本和j查询
答案 0 :(得分:0)
在asp.net代码中检测用户代理,然后加载相应的样式表和脚本
<% if(Request.UserAgent.contains("Android"){%>
include android CSS here
<%}else{%>
include iPhone css here
<%}%>
答案 1 :(得分:0)
您需要检测浏览器代理,然后相应地调用您的js / css:
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|AppleWebKit|IEMobile|Opera Mini/i.test(navigator.userAgent) )
{
// Call your files here.
}