gpt4 book ai didi

mysql - jquery datepicker 日历 - 用 mysql vb 填充

转载 作者:行者123 更新时间:2023-11-29 00:53:24 25 4
gpt4 key购买 nike

我目前在我的日期选择器中设置了基于我的 filter.js 文件的事件,该文件使用如下内容:

var events = [ 
{ Title: "1", Date: new Date("12/4/2010") },
{ Title: "2", Date: new Date("12/10/2010") }

];

我将这些日期存储在 mysql 数据库中,我需要从中提取日期而不是静态 js 文件。可以添加、更改日期等。

我正在使用 vb.net

最佳答案

建议创建一个网络服务来为您的最新事件/日期提供服务。然后您的 JavaScript 代码可以调用该 Web 服务。

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

<WebMethod> _
<ScriptMethod(ResponseFormat := ResponseFormat.Json)> _
Public Shared Function GetDates() As String
'return a collection as you need
End Function

在 JS 方面,call this web service using jQuery :

 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 

$.ajax({
type: "POST",
url: "YourWebServiceURL.aspx/GetDates",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {

var events ; //get your events from the msg object.
}
});

关于mysql - jquery datepicker 日历 - 用 mysql vb 填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7271635/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com