大佬教程收集整理的这篇文章主要介绍了MVC4捆绑小工具不支持JavaScript保留字,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
请看下面的错误,使用应该已经被细化的有效的javascript.
有没有人知道如何解决这个短的重写javascript来使用[“”]符号?
PS有问题的代码是几千行长,所以不是一个选择!
/* Minification failed. Returning unminified contents. (3,9-15): run-time warning JS1010: Expected identifier: delete (4,9-13): run-time warning JS1010: Expected identifier: case (5,9-11): run-time warning JS1010: Expected identifier: if (3,9-15): run-time error JS1137: 'delete' is a new reserved word and should not be used as an identifier: delete (4,9-13): run-time error JS1137: 'case' is a new reserved word and should not be used as an identifier: case (5,9-11): run-time error JS1137: 'if' is a new reserved word and should not be used as an identifier: if */ var context = {}; context.delete = {}; context.case = {}; context.if = {};
这个问题不是像节点,盒式磁带,梳子,服务器等其他选项
我们如何让MVC4用保留字播球.
我觉得很难相信,6个月以后再也没有这个支持!
public class CustomBundle : ScriptBundle { public CustomBundle(String virtualPath) : base(virtualPath) { this.builder = new CustomBuilder(); } public CustomBundle(String virtualPath,String cdnPath) : base(virtualPath,cdnPath) {} } public class CustomBuilder : IBundleBuilder { public String BuildBundleContent(Bundle bundle,BundleContext context,IEnumerable<FileInfo> files) { var content = new StringBuilder(); foreach (var fileInfo in files) { var parser = new Microsoft.Ajax.Utilities.JSParser(Read(fileInfo)); parser.SetTings.AddRenamePair("delete","foodelete"); content.Append(parser.Parse(parser.SetTings).ToCode()); content.Append(";"); } return content.ToString(); } private String Read(FileInfo filE) { using(var r = file.opentext()) { return r.ReadToEnd(); } } }
以上是大佬教程为你收集整理的MVC4捆绑小工具不支持JavaScript保留字全部内容,希望文章能够帮你解决MVC4捆绑小工具不支持JavaScript保留字所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。