如何禁用jQuery.Mobile.MVC? [英] how to disable jQuery.Mobile.MVC?
本文介绍了如何禁用jQuery.Mobile.MVC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为我的网站构建移动视图,但仍在创建过程中.我想测试它在实时设备上的外观.所以我想禁用.mobile文件,在下面,我厌倦了运行一些脚本来禁用但没有运气.
I building a mobile views for my website and i am still in process of creating them. i want to test how it would look on live device. so i would like to disable the .mobile files and below i tired running some scripts to disable but no luck.
<script>$(function () {
$('html').find('*').attr('data-role', 'none');
});
</script>
<script>$(document).ready(function () {
// disable ajax nav
$.mobile.ajaxEnabled = false;
});
</script>
也许这对开发人员来说是一个问题,但是否有人可以指出我正确的方向.
Maybe these is a question for the developers but if any one can point me in the right direction.
推荐答案
嘿Omar thanx寻求帮助,但我发现它如何禁用它[blog.mirajavora.com/overriding-browser-capabilities-in-asp.net]
hey Omar thanx for the help but i found it how disable it [blog.mirajavora.com/overriding-browser-capabilities-in-asp.net]
public class BrowserCapabilitiesSwitcherFilter : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
var switchParameter = f filterContext.RequestContext.HttpContext.Request.QueryString["switch"];
if(string.IsNullOrEmpty(switchParameter))
return;
var browserOverride = BrowserOverride.Desktop;
if(Enum.TryParse(switchParameter, true, out browserOverride))
{
//switch between BrowserOverride.Desktop / BrowserOverride.Mobile
filterContext.RequestContext.HttpContext.SetOverriddenBrowser(browserOverride);
}
else
{
//set the user-agent string
filterContext.RequestContext.HttpContext.SetOverriddenBrowser(switchParameter);
}
}
}
这篇关于如何禁用jQuery.Mobile.MVC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文