Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery grunt concat/uglify之后的firefox无响应脚本_Jquery_Angularjs_Firefox_Gruntjs_Concat - Fatal编程技术网

Jquery grunt concat/uglify之后的firefox无响应脚本

Jquery grunt concat/uglify之后的firefox无响应脚本,jquery,angularjs,firefox,gruntjs,concat,Jquery,Angularjs,Firefox,Gruntjs,Concat,Firefox在我丑陋的js上给了我一个无响应的脚本警告。Chrome和InternetExplorer很快就能加载该页面,因此它似乎是Firefox特有的 下面是我的GrunFile.js的相关部分 uglify : { options : { except : [ 'jQuery', 'angular' ] }, dist : { files : [ {

Firefox在我丑陋的js上给了我一个无响应的脚本警告。Chrome和InternetExplorer很快就能加载该页面,因此它似乎是Firefox特有的

下面是我的GrunFile.js的相关部分

uglify : {
        options : {
            except : [ 'jQuery', 'angular' ]
        },
        dist : {
            files : [
                    {
                        src : [ '<%= path.src %>/bower_components/jquery/dist/jquery.js',
                                '<%= path.src %>/bower_components/jquery-ui/jquery-ui.js',
                                '<%= path.src %>/bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js',
                                '<%= path.src %>/bower_components/angular/angular.js',
                                '<%= path.src %>/bower_components/angular-sanitize/angular-sanitize.js',
                                '<%= path.src %>/bower_components/angular-messages/angular-messages.js',
                                '<%= path.src %>/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
                                '<%= path.src %>/bower_components/ui-utils/ui-utils.js', 
                                '<%= path.src %>/bower_components/angular-ui-sortable/sortable.js',
                                '<%= path.src %>/bower_components/d3/d3.js',
                                '<%= path.src %>/bower_components/ng-csv/build/ng-csv.js',
                                '<%= path.src %>/bower_components/ng-device-detector/ng-device-detector.js',
                                '<%= path.src %>/bower_components/angular-shims-placeholder/dist/angular-shims-placeholder.js',
                                '<%= path.src %>/bower_components/angular-validation-match/dist/angular-input-match.min.js',
                                '<%= path.src %>/bower_components/angular-filter/dist/angular-filter.js',
                                '<%= path.src %>/bower_components/angular-toggle-switch/angular-toggle-switch.js',
                                '<%= path.src %>/bower_components/angular-ui-select/dist/select.js',
                                '<%= path.src %>/bower_components/ng-grid/build/ng-grid.js',
                                '<%= path.src %>/bower_components/angular-ui-grid/ui-grid.js',
                                '<%= path.src %>/bower_components/n3-line-chart/build/line-chart.js',
                                '<%= path.src %>/bower_components/ng-device-detector/ng-device-detector.js',
                                '<%= path.src %>/bower_components/angular-busy/dist/angular-busy.js' ],
                        dest : '<%= path.dist %>/js/<%= pkg.name %>.min.js'
                    } ]
        }`
uglify:{
选项:{
除了:['jQuery','angular']
},
地区:{
档案:[
{
src:['/bower_components/jquery/dist/jquery.js',
“/bower_components/jquery ui/jquery ui.js”,
“/bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js”,
“/bower_components/angular/angular.js”,
“/bower_components/angular sanitize/angular sanitize.js”,
“/bower_components/angular messages/angular messages.js”,
“/bower_components/angular bootstrap/ui bootstrap tpls.js”,
“/bower_components/ui-utils/ui-utils.js”,
“/bower_components/angular ui sortable/sortable.js”,
“/bower_components/d3/d3.js”,
“/bower_components/ng csv/build/ng csv.js”,
“/bower_components/ng device detector/ng device detector.js”,
“/bower_组件/角度垫片占位符/dist/角度垫片占位符.js”,
“/bower_components/angular validation match/dist/angular input match.min.js”,
“/bower_components/angular filter/dist/angular filter.js”,
“/bower_components/angular toggle switch/angular toggle switch.js”,
“/bower_components/angular ui select/dist/select.js”,
“/bower_components/ng grid/build/ng grid.js”,
“/bower_components/angular ui grid/ui grid.js”,
“/bower_components/n3折线图/build/linechart.js”,
“/bower_components/ng device detector/ng device detector.js”,
“/bower_components/angular busy/dist/angular busy.js”],
dest:“/js/.min.js”
} ]
}`
兴趣点

  • 它并不是孤立于我运行的机器,因为使用firefox访问页面的任何人都存在问题
  • 如果我把js文件分成更小的块,然后丑陋地分成6个左右的文件,那么我就不会遇到无响应的脚本问题。只有当我丑陋地分成一个或几个文件时,它才会存在
  • 问题在于我是在做一个完全丑陋的工作,还是只是简单地连接js文件
  • 如果我不进行任何连接,问题就不存在
  • 控制台中没有js错误

发布本文后,我发现js图表(可以与n3/d3图表隔离)当Firebug运行时,会导致Firefox出现大量性能问题。如果Firebug在js图表页面上打开,这些问题甚至会在关闭Firebug后持续存在。如果您打开Firefox和Firebug的新实例,您将不会遇到此问题,但随着时间的推移,似乎会出现某种泄漏,导致性能迅速下降这个问题似乎只存在于连接的js代码中