Just created a new project on ASP.NET Core 2.0. Connect all the necessary libraries. JQoure works without problems. But it is in this method does not go. The api controller normally returns the value. As in my previous all the same.
<script> function getData(data) { //var x = document.getElementById("brand"); //var option = document.createElement("option"); //option.text = "Kiwi"; //x.add(option); var url = "/api/CarData"; $.getJSON(url, function (data) { var obj = $.parseJSON(data); var x = document.getElementById("brand"); var option = document.createElement("option"); option.text = "hello"; x.add(option) }); } $(document).ready(function () { getData(); }); <form> <select id="brand" size="8"> <option>Apple</option> </select> </form> The selection itself is located if the lines above are uncommented. But why doesn’t it go into the gedjson method ... xs ... All libraries are connected. He did the same as in my previous project and there everything plows. What did I do?