Что может быть не так, когда Web API перестал работать во всех моих jquery вызовах? - PullRequest
0 голосов
/ 10 марта 2020

У меня есть веб-сайт, использующий html, css и jquery. Я использую jquery для отправки и извлечения данных из базы данных sql. Многие из моих звонков сработали отлично, но, к счастью, больше не работают. Я не имею ни малейшего понятия, что происходит сейчас. Единственное, что произошло, это то, что jquery перестал работать, и мне пришлось снова тянуть: в мой код. Где искать решение этой ошибки?

 @ Page Language="C#" AutoEventWireup="true" CodeBehind="Login_page4.aspx.cs" Inherits="apiwebsite.Login_page4" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title>Login_page4</title>

<script src="Scripts/jquery-3.4.0.slim.js"></script>
<script src="http://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script src="Scripts/jquery-3.4.0.intellisense.js"></script>
<script>
        function clock()
        {
            document.getElementById("displayTime").innerHTML = Date();
        }           

        $(document).ready(function ()
        {
            setInterval(clock, 1000);
            document.getElementById("selectmachine").style.height = "30px";
            document.getElementById("selectmachine").style.backgroundColor = "#f2f2f2";
            $("#selectmachine").css("width", "200px");


            document.getElementById("selectoperator").style.height = "30px";
            document.getElementById("selectoperator").style.backgroundColor = "#f2f2f2";
            $("#selectoperator").css("width", "200px");

            document.getElementById("notice").style.color = "red";


            $("#butlogin").css("width", "200px");
            $("#butlogin").css('backgroundColor', '#f2f2f2');

            $("#butlogout").css("width", "200px");
            $("#butlogout").css('backgroundColor', '#f2f2f2');

            $("#order").css("width", "200px");
            $("#order").css('backgroundColor', '#f2f2f2');

            $("#material").css("width", "200px");
            $("#material").css('backgroundColor', '#f2f2f2');


            logonmachine();
            GetSelected(callback);

});
        function logonmachine() {


            $("#butlogin").click(function (e) {
                e.preventDefault();

                selected = 1;

                alert('Selected er: ' + selected)

                if (selected == 1) {

                    $("#notice").html("Du er nu logget ind..")
                    T = login();
                    alert(T);
logout(T);

                }

                else {
                    $("#notice").html("Du er allerede logget ind..")
                }
            });


 function login() {

         var d = new Date();   //insert data in table login
         var time = d.getTime();
         return time;

     };


     function logout(T) {
         var date = new Date();
         var logout = date.getTime();
         var insert = {};
         insert.login_time2 = T;
         insert.logout_time2 = logout;
         insert.name = $("#selectoperator").val();
         insert.ordernumber = $("#order").val();
         insert.material = $("#material").val();
         insert.machinename = $("#selectmachine").val();

         $("#Butlogin").show();

         $.ajax({
             url: "http://localhost:52059/api/logout/login",
             type: "POST",
             contentType: "Application/json;charset=utf-8",
             data: JSON.stringify(insert),
             dataType: "json",
             success: function (response) {
                 alert(response)
             }
         });
     };



     ```` 
...