Telerik的()。ScriptRegistrar()如何prevent加载的jQuery库? [英] Telerik().ScriptRegistrar() How to prevent loading jquery libraries?
问题描述
脚本加载注册商甚至jquery.validation.min.js后
Script registrar loads jquery.validation.min.js even after
Html.Telerik().ScriptRegistrar().jQuery(false)
有没有办法告诉它不这样做?
Is there any way to tell it not to do so?
甚至当我尝试加载正是我需要的,这样做的:
Even when I try to load exactly what I need, doing this:
@Html.Telerik().ScriptRegistrar().jQuery(false).DefaultGroup(g =>
{
g.Add("telerik.common.min.js");
g.Add("telerik.tabstrip.min.js");
}
和例如如果我有页面上的网格Telerik的它会加载所有必要的脚本,包括grid.min,grid.editing和jquery.validate.min。
And if for example I have a telerik grid on the page it would load all necessary scripts including grid.min, grid.editing and jquery.validate.min.
我preFER来控制它自己和而不是简单地得到一个错误,或者非功能性元素,如果我忘了定义正确的脚本。
I prefer to control it myself and instead of that simply to get an error, or non-functioning elements if I forgot to define the right scripts.
如果我尝试使用这个片段:
If I try to use this snippet:
@Html.Telerik().ScriptRegistrar().jQuery(false).Scripts(s =>
{
s.Add("telerik.common.min.js");
...
它忽略 useTelerikContentDeliveryNetwork =真正的
在web.config中,并且搜索本地服务器上的脚本。我仍然想使用CDN。
It ignores useTelerikContentDeliveryNetwork="true"
in web.config, and searches for scripts on local server. I still want to use CDN.
UPD:有没有实际使用Telerik的CDN来源,但如果由于某种原因,他们都放下,从项目的服务器加载所有的东西的一种方式。
UPD: Is there actually a way to use telerik's CDN sources but if for some reason they are down, load all the stuff from the project's server?
推荐答案
作为进一步的更新,这个答案的人来自搜索引擎:您现在可以在addtion删除jQuery验证jQuery的使用是这样的:
As a further update to this answer for people coming from search engines: You can now remove jQuery Validation in addtion to jQuery by using something like:
@Html.Telerik().ScriptRegistrar().jQuery(false).jQueryValidation(false)
这篇关于Telerik的()。ScriptRegistrar()如何prevent加载的jQuery库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!