Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/476.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
Javascript 如何顺序调用相同的控制器方法而不在客户端使用async:false?_Javascript_Html_Model View Controller - Fatal编程技术网

Javascript 如何顺序调用相同的控制器方法而不在客户端使用async:false?

Javascript 如何顺序调用相同的控制器方法而不在客户端使用async:false?,javascript,html,model-view-controller,Javascript,Html,Model View Controller,我需要调用“CodeListLookup”方法,当在客户端加载页面时,该方法在控制器中两次使用不同的值。目前它的工作如预期,但不是第一次?我通过添加async:false解决了这个问题。但我需要一个替代方案来克服这个问题?下面我添加了Javascript代码 RepairEstimatePriorities: new kendo.data.DataSource({ transport: { read: {

我需要调用
“CodeListLookup”
方法,当在客户端加载页面时,该方法在控制器中两次使用不同的值。目前它的工作如预期,但不是第一次?我通过添加
async:false
解决了这个问题。但我需要一个替代方案来克服这个问题?下面我添加了Javascript代码

 RepairEstimatePriorities: new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: '@Url.Action("CodeListLookup", "GeneralData", new { Area = "Settings" })/?codeListType=PriorityType',
                            dataType: "json",
                            contentType: "application/json; charset=utf-8",
                            type: "GET"
                        }
                    }
                }),

                RepairEstimateServiceTypes: new kendo.data.DataSource({
                    transport: {
                        read: {
                            type: "GET",
                            datatype: "json",
                            url: '@Url.Action("CodeListLookup", "GeneralData", new { Area = "Settings" })/?codeListType=ServiceType',
                            contentType: "application/json; charset=utf-8",
                        }
                    }
                }),
谢谢你的帮助

 RepairEstimatePriorities: new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: '@Url.Action("CodeListLookup", "GeneralData", new { Area = "Settings" })/?codeListType=PriorityType',
                            dataType: "json",
                            contentType: "application/json; charset=utf-8",
                            type: "GET"
                        }
                    }
                }),

                RepairEstimateServiceTypes: new kendo.data.DataSource({
                    transport: {
                        read: {
                            type: "GET",
                            datatype: "json",
                            url: '@Url.Action("CodeListLookup", "GeneralData", new { Area = "Settings" })/?codeListType=ServiceType',
                            contentType: "application/json; charset=utf-8",
                        }
                    }
                }),
JavaScript:

 RepairEstimatePriorities: new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: '@Url.Action("CodeListLookup", "GeneralData", new { Area = "Settings" })/?codeListType=PriorityType',
                            dataType: "json",
                            contentType: "application/json; charset=utf-8",
                            type: "GET"
                        }
                    }
                }),

                RepairEstimateServiceTypes: new kendo.data.DataSource({
                    transport: {
                        read: {
                            type: "GET",
                            datatype: "json",
                            url: '@Url.Action("CodeListLookup", "GeneralData", new { Area = "Settings" })/?codeListType=ServiceType',
                            contentType: "application/json; charset=utf-8",
                        }
                    }
                }),
下面是我收到的错误:

 RepairEstimatePriorities: new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: '@Url.Action("CodeListLookup", "GeneralData", new { Area = "Settings" })/?codeListType=PriorityType',
                            dataType: "json",
                            contentType: "application/json; charset=utf-8",
                            type: "GET"
                        }
                    }
                }),

                RepairEstimateServiceTypes: new kendo.data.DataSource({
                    transport: {
                        read: {
                            type: "GET",
                            datatype: "json",
                            url: '@Url.Action("CodeListLookup", "GeneralData", new { Area = "Settings" })/?codeListType=ServiceType',
                            contentType: "application/json; charset=utf-8",
                        }
                    }
                }),
Uncaught TypeError: e.slice is not a function