This is a migrated thread and some comments may be shown as answers.

Does the DataSource component support CORS in IE9?

1 Answer 165 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
rgullhaug
Top achievements
Rank 1
rgullhaug asked on 03 Apr 2012, 10:19 AM
I have the following code which works perfectly in Chrome and Firefox, but it does not work in IE9. The server has the correct CORS header Access-Control-Allow-Origin

I don't get any errormsg in IE, but when i start network trace in the F12 developer tools I Can see that it is not trying to read data at all. api.rambase.net is never accessed.
<!DOCTYPE html>
<head>
    <title></title>
    <link href="styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
    <link href="styles/kendo.default.min.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/kendo.web.min.js" type="text/javascript"></script>
</head>
<body>
    <div id="grid"></div>
    <script>
        $(document).ready(function () {
            var myDatasource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "http://api.rambase.net/sales/customers/",
                        dataType: "json",
                        data: {
                            access_token: "pJqsseeESsdfse-d9_8CMQPsLg2"
                        },
                        beforeSend: function (req) {
                            req.setRequestHeader('Accept', "application/json");
                        }
                    }
                },
                schema: {
                    data: "customers.customer"
                }
            })
 
            $("#grid").kendoGrid({
                dataSource: myDatasource
            });
        });
 
    </script>
</body>
</html>

1 Answer, 1 is accepted

Sort by
0
rgullhaug
Top achievements
Rank 1
answered on 03 Apr 2012, 04:44 PM
I found the solution. I need to add a javascript  to enable Jquery.Ajax to work with CORS in IE. See http://www.kendoui.com/blogs/teamblog/posts/11-10-04/using_cors_with_all_modern_browsers.aspx
Tags
Data Source
Asked by
rgullhaug
Top achievements
Rank 1
Answers by
rgullhaug
Top achievements
Rank 1
Share this question
or