问题标签 [jquery-ajaxq]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
4 回答
88 浏览

jquery - Ajax 没有调用适当的操作

我试图从 html razor 表单(在视图中)调用另一个操作而不是我的默认操作,但它总是调用默认方法。我为此使用了 jquery ajax,但无法解决此问题。我尝试过使用以下代码。

Html剃须刀代码:-

Jquery Ajax 代码:-

在此,如果我单击“AddAnother”按钮,它会调用默认的“InitialView”操作,我想改为调用“AddNew”操作。通过使用上面的 jquery 代码,它不会执行。我该如何解决这个问题?

0 投票
1 回答
448 浏览

c# - 为什么jquery ajax方法只能调用webmethod

在使用 jQuery Ajax 方法时,我知道该方法只能调用 webmethod 或 mvc 的 get/post。为什么我不能使用 ajax 方法调用普通函数?

例子:

假设,我正在调用 CS.aspx 页面的 GetCurrentTime() 方法,那么我需要用属性WebMethod装饰 GetCurrentTime() ,以便从 ajax 方法进行调用。

0 投票
2 回答
749 浏览

jquery - Unable to Create Chart in Highcharts and id is undefined

Hi i am building a pie chart by passing json array to drawchart it displaying labels of chart but unable to find the chart.i need a donut chart where each slice is clickable which carries a id as it parameter when i click the slice it need to open a another chart of that particular slicethis is the final out put what i am able to see

0 投票
0 回答
22 浏览

jquery - 编辑搜索字段时自动完成 jquery 的问题

我正在使用 AJAX 借助 jQuery 中的自动完成功能进行文本更改搜索,以按学员的姓名搜索学员。一切正常,但是当我编辑(使搜索字段为空)时,我得到一个空列表而不是总列表。我怎样才能解决这个问题?

0 投票
1 回答
651 浏览

asp.net-mvc-5 - SignalR Hub 方法映射 mvc 5 服务器端方法

我开发了一个需要使用 signalR 的 asp.net mvc 5 应用程序。我已经创建了集线器,并且能够与集线器连接。现在我面临的主要问题是如何将服务器端方法与集线器映射。如果有任何可以帮助我的signalR,我对我来说是全新的,这对我来说将是一个很大的帮助。这是我的代码:

0 投票
2 回答
1652 浏览

asp.net-mvc-5 - SignalR Database Update Notification

I am developing an application in asp.net mvc 5. In this project I'm using signalR to show the updated data in real time. That means when any data will change than it will be loaded in application UI. But unfortunately it's not loaded automatically unless I refresh the page.

Here is my code below :

0 投票
2 回答
2044 浏览

jquery - 使用ajax将链接ID传递给php页面并在另一个div中打开

我有一个带有如下链接的 index.php 页面:

我在同一页面上有一个 div 容器,如下所示:

和 ajax jQuery 代码在同一页面上,如下所示:

我的工作是将上面的 id=1 传递到 test.php 的链接中,并获取在 div #container 的同一页面中显示的值。

问题是单击链接会在带有 url test.php?id=1 的新窗口中打开一个新页面,而不是在同一页面上显示 php 的内容。

如何在 jquery 中显示同一页面的名为#container 的 div 上的 test.php 页面的结果???

提前致谢。

0 投票
1 回答
1728 浏览

spring - 如何从 Spring Controller 获取 JSON 响应到 JQueryAjax?

如何从 Spring Controller 获取 json 响应到 JQueryAjax,
我正在尝试从 Controller 获取 json 数据但在 JQueryAjax 中出现错误 ststus,我的代码中有任何错误这是一个简单的登录应用程序这是我在 Spring 中的控制器

这是我的 JQueryAjax

数据.js

我添加了依赖文件

但是我在 ajax 中没有得到 json 响应,只是得到错误,为什么?控制台中的一个错误是

[http-nio-8080-exec-5] 警告 org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - 处理程序执行导致异常:找不到可接受的表示

0 投票
3 回答
727 浏览

spring - 如何使用 Spring 获取从 Controller 到 JQueryAjax 的 json 数据响应?

如何使用 Spring 获取从 Controller 到 JQueryAjax 的 json 数据
响应

这是我在 Spring 中的控制器

家庭控制器.java

这是我的 JQueryAjax

数据.js

我添加了依赖文件

我的调度程序-servlet.xml

但是我在 ajax 中没有得到 json 响应,只是得到错误,为什么?

在控制台中显示错误

[http-nio-8080-exec-5] 警告 org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - 处理程序执行导致异常:找不到可接受的表示

我的浏览器控制台也出现 406 错误

0 投票
2 回答
279 浏览

ajax - 如何增加 GIF 图像的加载时间?

在 AJAX 方法之前,我添加了一个 GIF 图像,但加载时间很短。如何设置加载持续时间的时间,然后显示 AJAX 响应?