首页 \ 问答 \ es5-shim和underscore.js?(es5-shim and underscore.js?)

es5-shim和underscore.js?(es5-shim and underscore.js?)

我的JavaScript项目中有es5-shim.jsunderscore.js

es5-shim.js只需添加一些JavaScript本机功能,如reducesome数组为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 and some 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
更新时间:2023-04-28 22:04

最满意答案

感谢太空人,问题解决了! 问题是通过将此代码添加到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" />

相关问答

更多
  • [更新]请参阅以下链接,该版本使用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 ...
  • 您只分配一次数据 - 但GLUtesselator一次只需要一组数据! 你在这里做的是将所有顶点数据放在内存中的一个位置,在原始代码中,每个顶点都有内存。 GLUtesselator需要多个顶点才能正常运行。 你打电话 void gluDeleteTess(GLUtesselator *tessobj); ......之后,你呢? You allocate the data only once -- but GLUtesselator needs more than one set of data at ...
  • 感谢太空人,问题解决了! 问题是通过将此代码添加到web.config解决了404错误 ...
  • 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 ...
  • 所以,我没有得到任何好的答案,所以我决定采用的方法是移植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 / MVC应用程序中工作的过程 。 根据您执行过的步骤,看起来您错过了(与我所获得的相比): <%= StackExchange.Profiling.ClientTimingHelper.InitScript %> 也就是说,即使没有那条线,我仍然会看到服务器端时序和MiniProfiler UI,所以我怀疑你的web.config条目是/不正确。 检查以确保您已将其放在web.config中的configur ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)