2017-08-09 33 views
0

我試圖使用JQuery UI的可排序功能(請參閱http://jqueryui.com/sortable/)按日期通過將作業列表拖動到某個員工來安排工作分配。在生產中加載頁面時未響應的腳本,但未在開發中

它在我的開發環境中看起來很好。它加載速度快,工作正常。但是,當我發佈到我的生產服務器並嘗試在我的生產站點上加載相同頁面時,它會鎖定。

等待了一會兒,告訴反應遲鈍頁面停止後,我收到以下錯誤,在Firefox中的控制檯:

Error: Script terminated by timeout at: 
w</[email protected]://productionserver/bundles/jquery?v=v5ipibJm7AKDxo-gwvDlrhtKDuuTixthciRUzTvH4GU1:1:122745 
[email protected]://productionserver/bundles/jquery?v=v5ipibJm7AKDxo-gwvDlrhtKDuuTixthciRUzTvH4GU1:1:133074 
[email protected]://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:9595 
[email protected]://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:8850 
[email protected]://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:9474 
[email protected]://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:9266 
_setHandleClassName/<@http://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:204369 
[email protected]://productionserver/bundles/jquery?v=v5ipibJm7AKDxo-gwvDlrhtKDuuTixthciRUzTvH4GU1:1:110253 
[email protected]://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:204340 
n.widget/</h[t]</<@http://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:4508 
[email protected]://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:213332 
n.widget/</h[t]</<@http://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:4508 
[email protected]://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:204024 
n.widget/</h[t]</<@http://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:4508 
[email protected]://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:6648 
n.widget/n[e][t]@http://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:4069 
n.widget.bridge/n.fn[t]/<@http://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:5885 
[email protected]://productionserver/bundles/jquery?v=v5ipibJm7AKDxo-gwvDlrhtKDuuTixthciRUzTvH4GU1:1:110253 
[email protected]://productionserver/bundles/jquery?v=v5ipibJm7AKDxo-gwvDlrhtKDuuTixthciRUzTvH4GU1:1:108205 
n.widget.bridge/n.fn[t]@http://productionserver/bundles/jqueryui?v=tG29gr4b89aZuHZhwb2RRduOLQe69zZ-D0yHV7Mp9SM1:1:5790 
@http://productionserver/JobScheduling/MainJobBoard/:6304:7 
[email protected]://productionserver/bundles/jquery?v=v5ipibJm7AKDxo-gwvDlrhtKDuuTixthciRUzTvH4GU1:1:134341 
[email protected]://productionserver/bundles/jquery?v=v5ipibJm7AKDxo-gwvDlrhtKDuuTixthciRUzTvH4GU1:1:135109 
[email protected]://productionserver/bundles/jquery?v=v5ipibJm7AKDxo-gwvDlrhtKDuuTixthciRUzTvH4GU1:1:136894 
[email protected]://productionserver/bundles/jquery?v=v5ipibJm7AKDxo-gwvDlrhtKDuuTixthciRUzTvH4GU1:1:94196 

我想這可能是與捆綁或腳本的縮小文件,但是當我在BundleConfig.cs中設置BundleTable.EnableOptimizations = true;並在Visual Studio中運行它時,一切正常。我也嘗試在Release中運行並在Web.config中設置compilation debug="false"。兩者都很好。

供參考,這是我的BundleConfig.cs RegisterBundles方法:

bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
    "~/Scripts/jquery-ui-{version}.js")); 

    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
       "~/Scripts/jquery-{version}.js")); 

    bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
       "~/Scripts/jquery.validate*")); 


    bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
       "~/Scripts/modernizr-*")); 


    bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
       "~/Scripts/bootstrap.js", 
       "~/Scripts/bootstrap-datepicker.js", 
       "~/Scripts/DatePickerReady.js", 
       "~/Scripts/respond.js")); 

    bundles.Add(new StyleBundle("~/Content/jqueryuicss").IncludeDirectory("~/Content/themes/base", "*.css", false)); 

    bundles.Add(new StyleBundle("~/Content/css").Include(
       "~/Content/bootstrap.css", 
       "~/Content/bootstrap-datepicker3.css", 
       "~/Content/site.css")); 

什麼引起我的網頁在生產中鎖定,而不是在發展?我需要改變什麼?

任何幫助,將不勝感激。

回答

0

看起來它是由加載大量項目列表引起的。我在一個清單中有幾百個項目,總共有兩百個清單。在我的開發環境中,我只加載了相對少量的測試數據,最多在列表數量相同的列表中有大約40個。

我只需要確保我將顯示的數據量限制在合理的數量。

相關問題