当Web API在我所有的jquery调用中停止工作时,会出现什么问题?
我有一个使用html、css和jquery的网站。我使用jquery从sql数据库发送和检索数据。我的许多电话都工作得很好,但突然之间没有任何工作了。我不知道现在发生了什么事。唯一发生的事情是jquery停止工作,我不得不拉: 再次输入我的代码。在哪里可以找到解决此错误的方法当Web API在我所有的jquery调用中停止工作时,会出现什么问题?,jquery,webapi,Jquery,Webapi,我有一个使用html、css和jquery的网站。我使用jquery从sql数据库发送和检索数据。我的许多电话都工作得很好,但突然之间没有任何工作了。我不知道现在发生了什么事。唯一发生的事情是jquery停止工作,我不得不拉: 再次输入我的代码。在哪里可以找到解决此错误的方法 @ Page Language="C#" AutoEventWireup="true" CodeBehind="Login_page4.aspx.cs" Inherits="apiwebsite.Login_page4"
@ 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)
}
});
};
````
@Page Language=“C#”AutoEventWireup=“true”codebeand=“Login_page4.aspx.cs”Inherits=“apiwebsite.Login_page4”%”
登录页面4
功能时钟()
{
document.getElementById(“displayTime”).innerHTML=Date();
}
$(文档).ready(函数()
{
设置间隔(时钟,1000);
document.getElementById(“selectmachine”).style.height=“30px”;
document.getElementById(“selectmachine”).style.backgroundColor=“#f2f2”;
$(“#selectmachine”).css(“宽度”,“200px”);
document.getElementById(“selectoperator”).style.height=“30px”;
document.getElementById(“selectoperator”).style.backgroundColor=“#f2f2”;
$(“#selectoperator”).css(“宽度”,“200px”);
document.getElementById(“通知”).style.color=“红色”;
$(“#butlogin”).css(“宽度”,“200px”);
$(“#butlogin”).css('backgroundColor','#f2f2');
$(“#但注销”).css(“宽度”,“200px”);
$(“#butlogout”).css('backgroundColor','#f2f2');
$(“订单”).css(“宽度”,“200px”);
$(“#order”).css('backgroundColor','#f2f2');
$(“材料”).css(“宽度”,“200px”);
$(“#material”).css('backgroundColor','#f2f2');
logonmachine();
GetSelected(回调);
});
函数logonmachine(){
$(“#但登录”)。单击(函数(e){
e、 预防默认值();
所选=1;
警报(“选定的er:”+选定的)
如果(所选==1){
$(“#注意”).html(“duer nu logget ind.)
T=登录();
警报(T);
注销(T);
}
否则{
$(“#注意”).html(“Du er allerede logget ind.)
}
});
函数登录(){
var d=new Date();//在表登录中插入数据
var time=d.getTime();
返回时间;
};
功能注销(T){
变量日期=新日期();
var logout=date.getTime();
var insert={};
insert.login_time2=T;
insert.logout_time2=注销;
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",
类型:“POST”,
contentType:“应用程序/json;字符集=utf-8”,
数据:JSON.stringify(insert),
数据类型:“json”,
成功:功能(响应){
警报(响应)
}
});
};
````
如果没有代码示例、错误示例和更多详细信息,我们无法帮助您解决此问题。请阅读我对我的数据库的所有调用都不起作用,但您需要查看哪些代码?如果您在调用数据库时遇到问题,与数据库调用相关的代码将与此情况相关。还请告知我们您收到的确切错误。我的控制器工作正常。我将在PostmanDoes中对其进行测试。函数logout()
调用调用数据库的API吗?它在哪里失败?如果不是,它在哪里失败?