es5-shim和underscore.js?(es5-shim and underscore.js?)
我的JavaScript项目中有es5-shim.js和underscore.js 。
es5-shim.js只需添加一些JavaScript本机功能,如
reduce
和some
数组为Internet Explorer和一些旧的浏览器。 underscore.js添加相同的东西(但语法不同)以及更多东西(对象和数组的实用函数)。但是,如果存在由es5-shim添加的函数,则underscore.js会使用它们。
因此,在Firefox或Chrome等“近期”浏览器中,underscore.js使用浏览器的本机功能。 我认为它比纯JavaScript功能更好。 但在Internet Explorer上,underscore.js使用es5-shim函数。 如果我删除es5-shim.js,underscore.js使用它自己的函数。
对此有何建议? 我应该从我的项目中删除es5-shim,只使用underscore.js? 或者我应该让underscore.js使用es5-shim的函数?
I have both es5-shim.js and underscore.js in my JavaScript project.
es5-shim.js just add some javascript native functions like
reduce
andsome
on arrays for Internet Explorer and some old browsers. underscore.js add the same thing (but with a different syntax) and many more thing (utility functions on objects and arrays).But, if the functions added by es5-shim exists, underscore.js use them.
So, on a "recent" browser like Firefox or Chrome, underscore.js use the native functions of the browser. I think it's better than a pure javascript function. But on Internet Explorer, underscore.js use the es5-shim functions. If I remove es5-shim.js, underscore.js use its own functions.
Any advice on that ? Should i remove es5-shim from my project and only use underscore.js ? Or should i let underscore.js use es5-shim's functions ?
原文:https://stackoverflow.com/questions/13540951
最满意答案
感谢太空人,问题解决了! 问题是通过将此代码添加到
web.config
解决了404错误<system.webServer> <handlers> <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
Thanks to spaceman the problem solved! the problem was from the 404 error solved by adding this code to
web.config
<system.webServer> <handlers> <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
相关问答
更多-
使用MiniProfiler的数据库分析与NHibernate(Using MiniProfiler's database profiling with NHibernate)[2023-06-20]
[更新]请参阅以下链接,该版本使用RealProxy代理SqlCommand - 现在支持批处理 博客http://blog.fearofaflatplanet.me.uk/mvcminiprofiler-and-nhibernate-take-2 gist https://gist.github.com/1110153 我原来的答案没有改变,因为它被接受。 [/ UPDATE] 通过实现一个Profiled Client驱动程序(下面是Sql Server 2008的示例),我已经设法部分让它工作了 - ... -
它可以完成,但需要一些额外的设置步骤: 设置MiniProfiler.Settings.Storage以保存到可从所有域访问的某些存储介质(如redis缓存或sql server)。 这将允许所有被分析的域将其结果保存在一起。 请务必将MiniProfiler.Current.User设置为在所有域上具有相同的值。 检索结果时的默认行为是显示特定用户的所有结果。 因此,您希望确保同一用户的配置文件在多个域中一致地存储。 It can be done, but would require some extra ...
-
为什么这不起作用?(Why doesn't this work?)[2022-03-19]
您只分配一次数据 - 但GLUtesselator一次只需要一组数据! 你在这里做的是将所有顶点数据放在内存中的一个位置,在原始代码中,每个顶点都有内存。 GLUtesselator需要多个顶点才能正常运行。 你打电话 void gluDeleteTess(GLUtesselator *tessobj); ......之后,你呢? You allocate the data only once -- but GLUtesselator needs more than one set of data at ... -
MiniProfiler不起作用(MiniProfiler Doesn't work)[2023-05-09]
感谢太空人,问题解决了! 问题是通过将此代码添加到web.config解决了404错误... -
Miniprofiler和umbraco(Miniprofiler and umbraco)[2023-04-27]
MiniProfiler内置于Umbraco v6和v7。 您不必手动设置它。 您所要做的就是通过在AppSettings中设置密钥来启用调试模式:并使用?umbDebug = true查询字符串参数加载页面。 MiniProfiler is built in to Umbraco v6 and v7. You don't have to manually setup it. All you have to do i ... -
当它尝试访问连接字符串时,代码会中断,因为连接字符串是实体框架样式连接字符串。 将连接字符串传递给小型分析器时,必须从EF连接字符串中提取实际的连接字符串。 EntityConnection connection = new EntityConnection(ConfigurationManager .ConnectionStrings["ConnectionStringName"].ConnectionString)); string connection ...
-
如何使ServiceStack MiniProfiler与EF配合使用?(How do I make the ServiceStack MiniProfiler work with EF?)[2022-12-17]
所以,我没有得到任何好的答案,所以我决定采用的方法是移植MiniProfiler.EF来运行ServiceStack。 幸运的是,这不是太多的努力。 结果如下: https : //github.com/driis/ServiceStack.MiniProfiler.EntityFramework 它与MiniProfiler.EF中的代码完全相同,只是调整了命名空间并修复了一些错误以使其编译。 要使用,只需将程序集放入项目(而不是MiniProfiler.EF包),并在启动代码中调用MiniProfile ... -
删除后 if (Request.IsLocal) 从 protected void Application_BeginRequest() { if (Request.IsLocal) { MiniProfiler.Start(); } } 它现在似乎工作正常。 After removing the if (Request.IsLocal) from protected void Application_BeginRequest() { if (Reque ...
-
Mini-profiler是一个相当简单(但有效)的分析器; 它不包括用于有创地钻入外部代码的钩子。 我希望使用mini-profiler,因为你需要从源代码进行自定义构建,添加显式的分析步骤。 这可能不是过度征税,但是还有其他工具专为入侵性分析而设计,可能更方便(但对整体性能影响更大)。 Mini-profiler is a fairly simple (but effective) profiler; it does not include hooks to drill invasively into ...
-
MiniProfiler和WebForms(MiniProfiler and WebForms)[2022-02-04]
我(非常!)最近在博客上发表了这篇文章,特别是让MiniProfiler在混合WebForms / MVC应用程序中工作的过程 。 根据您执行过的步骤,看起来您错过了(与我所获得的相比): <%= StackExchange.Profiling.ClientTimingHelper.InitScript %> 也就是说,即使没有那条线,我仍然会看到服务器端时序和MiniProfiler UI,所以我怀疑你的web.config条目是/不正确。 检查以确保您已将其放在web.config中的configur ...