javascript - 我可以使用在线资源在我的网站中使用 JQuery UI 小部件吗?

标签 javascript jquery asp.net jquery-ui datepicker

我一直在拿我的first jQuery今天早上的教程。这有点令人困惑。现在我只想使用 jQuery UI 在我的 asp 页面中显示 DatePicker。我在那里看到了多个样本。

This site is instructing to download jQuery UI 。是否需要将这些文件/插件下载到项目文件夹中?网页的可移植性怎么样?我不能refer to online resources to use DatePicker widget like what this tutorial shows

比如本站的解释:-

在 ASP.Net 应用程序中使用由 Google CDN(内容分发网络)托管的 JQuery 库。 Google's Content Distribution Network(also, AJAX Libraries API ) hosts most widely used open source JavaScript libraries which can be used globally across the websites. The main advantage of using google's CDN is they manage all the bug fixes, recent updates and provide a high speed access due to better caching, etc. If we are hosting a public website that uses JQuery, then it is advisable to use this Google's feature to host the JQuery library for us.

引用文献:

编辑:

显示 Plunker code在我的 aspx 页面中现在是一个问题。我只想在编辑模式下在文本框中显示日期选择器。

    <link href="default.css" rel="stylesheet" type="text/css" />
    <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.8.0.js" type="text/javascript"></script>  
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.js" type="text/javascript"></script>
            <link href="http://code.jquery.com/ui/1.9.1/themes/smoothness/jquery-ui.css" rel="Stylesheet" type="text/css" />
<script type="text/javascript">
    $(function () {
        $('#StartDateTBox').datepicker()
    })
</script>
<小时/>
<asp:TemplateField HeaderText="Start Date">
    <ItemTemplate>
        <asp:Label ID="Label4" runat="server" Text='<%# Bind("[Start Date]") %>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
       <asp:TextBox ID="StartDateTBox" runat="server"></asp:TextBox>
    </EditItemTemplate>
    <ItemStyle CssClass="itask" />
</asp:TemplateField>

最佳答案

您可以从众多 CDN 中提取 JS 和 CSS,包括 google、microsoft 和 code.jquery.com。

只需将适用的 CDN url 添加到链接或脚本标记

此外,meroller 中显示的主要主题也可用。

Here's a quick example using cdnjs.cloudfare CDN

关于javascript - 我可以使用在线资源在我的网站中使用 JQuery UI 小部件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24794295/

相关文章:

javascript - 如何遍历 JSON 列表并插入到 HTML 元素中?

javascript - 为什么 Twitter 将字符串传递到它的脚本加载 JS 片段中?

javascript - 使用 JQuery 将数据追加到表中

c# - 保存的 ZIP 文件损坏(从 Android 应用程序到 IIS 服务器)

c# - 在 ASP.NET 中使用带有友好 URL 的 Response.Redirect

javascript - 单击时检查表单中是否有不显示的元素

javascript - Vue/Nuxt/Vuex - [NUXT :SSR] [ERROR] [vuex] unknown getter

javascript - 如果选中一个复选框,则结束函数

javascript - 单击 <a> 时,如何使用 jquery 添加新的 <a> ?

c# - 如何将 "active"css 类添加到链接按钮代码后面