jquery 相关问题

jQuery是一个Javascript库,考虑添加Javascript标记。 jQuery是一个流行的跨浏览器JavaScript库,它通过最小化浏览器之间的差异来促进文档对象模型(DOM)遍历,事件处理,动画和AJAX交互。标记为jquery的问题应该与jquery相关,因此有问题的代码应该使用jquery,并且至少需要jquery与用法相关的元素。

如何在 jQuery DatePicker 中使用 Tab 键选择月份?

我一直在尝试在 jQuery 日期选择器中的“下个月”按钮上启用 keydown 事件。 这个想法是让用户不使用鼠标而只使用制表键和 Enter 键来选择日期。 我知道...

回答 2 投票 0

Bootstrap 3.4 版本与 JQuery 3.4 版本兼容吗?

Bootstrap 3.4 版本与 JQuery 3.4 版本兼容吗?或者我需要升级到 Bootstrap 版本 4 吗? 我不能使用 3.4 版之前的较低版本的 JQuery,因为根据我们的...

回答 1 投票 0

Bootstrap 3.3.6 和 JQuery 3.1.0 不兼容?

这两个(都是最新版本)有可能不兼容吗? (片段中:本地文件为最新版本,网上检索到的文件为旧版本) 有什么吗...

回答 3 投票 0

jQuery Datepicker:使用 Tab 键选择月份

我一直在尝试在 jQuery 日期选择器中的“下个月”按钮上启用 keydown 事件。 这个想法是让用户不使用鼠标而只使用制表键和 Enter 键来选择日期。 我知道...

回答 2 投票 0

在自定义 Angular 6+ 库中使用 jQuery

编辑2 我感觉我编写一个独立的角度库供其他人使用的方法是错误的? 我的第一个想法是编写一个 npm 模块,但它必须是私有的并且不能发布 - wo...

回答 4 投票 0

使用 jQuery 将 html 代码附加到 DataTable 后,Jquery DataTable 不起作用

我创建了一个数据表并将数据附加到该数据表主体,数据附加成功但数据表无法正常工作 例如:如果我单击数据表标题列,则整个

回答 1 投票 0

如何在chartjs中展开圆环图的切片?

有没有办法在chartjs中展开圆环图onclick事件或鼠标悬停的切片? 我使用的是[email protected]版本。

回答 4 投票 0

通过 bootstrap 在对话框模式上显示 PDF 文件引导示例<...</desc> <question vote="13"> <p>我的要求是,单击按钮后,应在对话框模式中显示 pdf 文件。 请帮忙!</p> <pre><code><!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>View PDF</h2> <!-- Trigger the modal with a button --> <button type="button" href="A - Cover Page.pdf" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">A - Cover Page</button> <!-- Modal --> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> </div> <div class="modal-body"> <p>Some text in the modal.</p> </div> </div> </div> </div> </div> </body> </html> </code></pre> </question> <answer tick="false" vote="27"> <p>您还可以将 pdf 嵌入模式中。 像这样:</p> <pre><code><embed src="sample.pdf" frameborder="0" width="100%" height="400px"> </code></pre> <p>这对我有用</p> </answer> <answer tick="true" vote="18"> <p>很抱歉让您失望,但默认情况下不能仅在模式中显示 pdf。这不是有意的行为。即使使用 <pre><code><iframe></code></pre>,您也无法在引导模式内渲染 pdf。此外,大多数在线提供的 hack 都不支持跨浏览器。更理想的方法是使用插件,我会给你一些链接,你可以使用它们来实现你想要的。</p> <p>1)结账<pre><code>PDFObject</code></pre>JS,</p> <pre><code><script src="https://github.com/pipwerks/PDFObject/blob/master/pdfobject.min.js"></script> </code></pre> <p>PDFObject 将 PDF 文件嵌入到 HTML 文档中。 <a href="http://pdfobject.com/" rel="noreferrer">链接</a>.</p> <p>2) Bootstrap 的简单模态插件。 <a href="http://bootsnipp.com/snippets/VX7EN" rel="noreferrer">演示片段</a>和<a href="http://saribe.github.io/eModal/#demo" rel="noreferrer">网站</a></p> <p>3) 使用 jQuery 对话框模态弹出窗口。 <a href="http://www.aspsnippets.com/demos/1261/" rel="noreferrer">演示</a>。</p> <p>希望有帮助。</p> </answer> <answer tick="false" vote="13"> <pre><code><div class="modal fade" id="modal-agreement"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-body"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <object type="application/pdf" data="path/to/pdf" width="100%" height="500" style="height: 85vh;">No Support</object> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> </code></pre> </answer> <answer tick="false" vote="2"> <p>你也可以试试这个</p> <p></p><div data-babel="false" data-lang="js" data-hide="false" data-console="true"> <div> <pre><code><!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>DisplayPDF</title> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <!-- Trigger the modal with a button --> <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button> <!-- Modal --> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Modal Header</h4> </div> <div class="modal-body"> <embed src="~file:///C:/Users/hp/Downloads/sb_finance.pdf" frameborder="0" width="100%" height="400px"> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> </div> </div> </body> </html></code></pre> </div> </div> <p></p> </answer> <answer tick="false" vote="1"> <p>可以在modal/popup中添加iframe。</p> <pre><code><iframe src="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" width="600" height="780" style="position: absolute;top: 66px;bottom: 0px;right: 0px;width: 100%;border: none;margin: 0;padding: 0;overflow: hidden;z-index: 3;height: 100%;"></iframe> </code></pre> <p>根据您的要求,您可以设置参数的样式。</p> </answer> <answer tick="false" vote="1"> <p>在 JS 中使用 Vuejs 全屏模态显示 pdf。</p> <p><strong>html</strong></p> <pre><code> <div class="modal " tabindex="-1" id="idXyz"> <div class="modal-dialog modal-fullscreen"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">[[formName]]</h5> <button type="button" class="btn btn-danger" data-bs-dismiss="modal" aria-label="Close">close </button> </div> <div class="modal-body"> <embed v-bind:src="getUrl" frameborder="0" width="100%" height="100%"> </div> </div> </div> </div> </code></pre> <p><strong>Javascript</strong></p> <pre><code>var pdfVueModal = new Vue({ el: '#idXyz', data: { getUrl: null, formName: null }, methods: { showPdf: function (getUrl, formName) { this.getUrl = getUrl; this.formName = formName; $('#idXyz').modal('show'); } }, delimiters: ["[[", "]]"], }); </code></pre> </answer> <answer tick="false" vote="0"> <p>但是我收到这样的错误:不允许加载本地资源:file:///D:/</p> <p>好吧...您的浏览器不允许直接从硬盘加载该文件。在你看来,你可能会得到这样的东西:</p> <pre><code><img src="C:\xampp\htdocs\socialNet\public\uploads\joew.png" /> </code></pre> <p>您需要浏览器的 URL 才能访问此图像。在您看来,您需要类似的东西:</p> <p>Laravel 中的 asset() 函数从公共文件夹创建一个 URL 并附加您提供的参数。因此,这将创建一个类似以下的 URL:<pre><code>http://localhost/public/uploads/joew.png</code></pre></p> <p>编辑:您指定的文件夹<pre><code>(storage_path)</code></pre>可能根本无法被浏览器读取。将上传更改为<pre><code>public_path('uploads')</code></pre>,即可访问。</p> </answer> <answer tick="false" vote="0"> <p></p><div data-babel="false" data-lang="js" data-hide="false" data-console="true"> <div> <pre><code><!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>DisplayPDF</title> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <!-- Trigger the modal with a button --> <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button> <!-- Modal --> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Modal Header</h4> </div> <div class="modal-body"> <embed src="~file:///C:/Users/hp/Downloads/sb_finance.pdf" frameborder="0" width="100%" height="400px"> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> </div> </div> </body> </html></code></pre> </div> </div> <p></p> </answer> </body></html>

我的要求是,单击按钮后,应在对话框模式中显示 pdf 文件。 请帮忙! 引导示例<...</desc> <question vote="13"> <p>我的要求是,单击按钮后,应在对话框模式中显示 pdf 文件。 请帮忙!</p> <pre><code><!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>View PDF</h2> <!-- Trigger the modal with a button --> <button type="button" href="A - Cover Page.pdf" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">A - Cover Page</button> <!-- Modal --> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> </div> <div class="modal-body"> <p>Some text in the modal.</p> </div> </div> </div> </div> </div> </body> </html> </code></pre> </question> <answer tick="false" vote="27"> <p>您还可以将 pdf 嵌入模式中。 像这样:</p> <pre><code><embed src="sample.pdf" frameborder="0" width="100%" height="400px"> </code></pre> <p>这对我有用</p> </answer> <answer tick="true" vote="18"> <p>很抱歉让您失望,但默认情况下不能仅在模式中显示 pdf。这不是有意的行为。即使使用 <pre><code><iframe></code></pre>,您也无法在引导模式内渲染 pdf。此外,大多数在线提供的 hack 都不支持跨浏览器。更理想的方法是使用插件,我会给你一些链接,你可以使用它们来实现你想要的。</p> <p>1)结账<pre><code>PDFObject</code></pre>JS,</p> <pre><code><script src="https://github.com/pipwerks/PDFObject/blob/master/pdfobject.min.js"></script> </code></pre> <p>PDFObject 将 PDF 文件嵌入到 HTML 文档中。 <a href="http://pdfobject.com/" rel="noreferrer">链接</a>.</p> <p>2) Bootstrap 的简单模态插件。 <a href="http://bootsnipp.com/snippets/VX7EN" rel="noreferrer">演示片段</a>和<a href="http://saribe.github.io/eModal/#demo" rel="noreferrer">网站</a></p> <p>3) 使用 jQuery 对话框模态弹出窗口。 <a href="http://www.aspsnippets.com/demos/1261/" rel="noreferrer">演示</a>。</p> <p>希望有帮助。</p> </answer> <answer tick="false" vote="13"> <pre><code><div class="modal fade" id="modal-agreement"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-body"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <object type="application/pdf" data="path/to/pdf" width="100%" height="500" style="height: 85vh;">No Support</object> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> </code></pre> </answer> <answer tick="false" vote="2"> <p>你也可以试试这个</p> <p></p><div data-babel="false" data-lang="js" data-hide="false" data-console="true"> <div> <pre><code><!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>DisplayPDF</title> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <!-- Trigger the modal with a button --> <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button> <!-- Modal --> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Modal Header</h4> </div> <div class="modal-body"> <embed src="~file:///C:/Users/hp/Downloads/sb_finance.pdf" frameborder="0" width="100%" height="400px"> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> </div> </div> </body> </html></code></pre> </div> </div> <p></p> </answer> <answer tick="false" vote="1"> <p>可以在modal/popup中添加iframe。</p> <pre><code><iframe src="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" width="600" height="780" style="position: absolute;top: 66px;bottom: 0px;right: 0px;width: 100%;border: none;margin: 0;padding: 0;overflow: hidden;z-index: 3;height: 100%;"></iframe> </code></pre> <p>根据您的要求,您可以设置参数的样式。</p> </answer> <answer tick="false" vote="1"> <p>在 JS 中使用 Vuejs 全屏模态显示 pdf。</p> <p><strong>html</strong></p> <pre><code> <div class="modal " tabindex="-1" id="idXyz"> <div class="modal-dialog modal-fullscreen"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">[[formName]]</h5> <button type="button" class="btn btn-danger" data-bs-dismiss="modal" aria-label="Close">close </button> </div> <div class="modal-body"> <embed v-bind:src="getUrl" frameborder="0" width="100%" height="100%"> </div> </div> </div> </div> </code></pre> <p><strong>Javascript</strong></p> <pre><code>var pdfVueModal = new Vue({ el: '#idXyz', data: { getUrl: null, formName: null }, methods: { showPdf: function (getUrl, formName) { this.getUrl = getUrl; this.formName = formName; $('#idXyz').modal('show'); } }, delimiters: ["[[", "]]"], }); </code></pre> </answer> <answer tick="false" vote="0"> <p>但是我收到这样的错误:不允许加载本地资源:file:///D:/</p> <p>好吧...您的浏览器不允许直接从硬盘加载该文件。在你看来,你可能会得到这样的东西:</p> <pre><code><img src="C:\xampp\htdocs\socialNet\public\uploads\joew.png" /> </code></pre> <p>您需要浏览器的 URL 才能访问此图像。在您看来,您需要类似的东西:</p> <p>Laravel 中的 asset() 函数从公共文件夹创建一个 URL 并附加您提供的参数。因此,这将创建一个类似以下的 URL:<pre><code>http://localhost/public/uploads/joew.png</code></pre></p> <p>编辑:您指定的文件夹<pre><code>(storage_path)</code></pre>可能根本无法被浏览器读取。将上传更改为<pre><code>public_path('uploads')</code></pre>,即可访问。</p> </answer> <answer tick="false" vote="0"> <p></p><div data-babel="false" data-lang="js" data-hide="false" data-console="true"> <div> <pre><code><!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>DisplayPDF</title> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <!-- Trigger the modal with a button --> <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button> <!-- Modal --> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Modal Header</h4> </div> <div class="modal-body"> <embed src="~file:///C:/Users/hp/Downloads/sb_finance.pdf" frameborder="0" width="100%" height="400px"> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> </div> </div> </body> </html></code></pre> </div> </div> <p></p> </answer> </body></html>

回答 0 投票 0

JavaScript 嵌套 AJAX 调用并承诺如何正确链接?

我坚持为以下设置正确的执行顺序。假设,我需要进行 AJAX 调用,然后处理数据并将其存储在 IndexedDB 中。我为此使用 idb-keyval lib,它的操作...

回答 1 投票 0

在整个页面加载之前显示加载栏

我想在加载整个页面之前显示一个加载栏。目前,我只是使用了一个小的延迟: $(文档).ready(函数(){ $('#page').fadeIn(2000); }); 该页面已使用...

回答 6 投票 0

jQuery - 确定输入元素是文本框还是选择列表

如何确定 jQuery 中 :input 过滤器返回的元素是文本框还是选择列表? 我希望每个都有不同的行为(文本框返回文本值,选择返回

回答 4 投票 0

单选按钮星级评定是从右到左而不是从左到右

让悬停从最左边到最右边的星星有什么技巧? 例如 flex-direction: row-reverse;方向:rtl;不算数,因为它们颠倒了

回答 5 投票 0

如何在 JavaScript 中修剪文件名的长度但保留扩展名?

例如,我有一些文件上传到我的服务器,名称很大,如下所示: 1507633_519504261504361_1763887042_n.jpg 在这种情况下,显示长度太长,弄乱了f...

回答 7 投票 0

显示时禁用 jquery ui 单选按钮的焦点

当我自动使用 jquery ui 单选按钮时,第一个单选按钮将获得焦点。 我怎样才能禁用它

回答 2 投票 0

在If-else块中使用ready()方法来调用函数是一个好习惯吗?

我正在尝试调用 test() 函数 onload。我就是这样做的: if ($('.partical.sectionA').length) { $(文档).ready(函数(){ 测试($(这个)); }); } 测试(某事)...

回答 1 投票 0

如何动态改变EJS中元素的属性

我已经为这个问题苦苦挣扎了一段时间。我试图在我的 EJS 中使用 jQuery 来更改元素的属性。然而在Google上搜索了很长时间,我还是无法找到...

回答 1 投票 0

Ajax 无法在使用 Webforms Visual Basic 的 DataTable 中工作

供参考,我使用的是DataTable 2.0.6 我似乎无法让 DataTable 在 Visual Basic 中调用 aspx webforms 中的函数。 此方法有效: $.ajax({ 类型:'发布', url: 'Index.aspx/

回答 1 投票 0

连接两个字符串以在 html 属性中使用

我得到: 当我想要的时候: 我得到: <tr data-providernum="12345" data-providername="JARVIS," claire="" elizabeth=""> 当我想要的时候: <tr data-providernum="12345" data-providername="JARVIS, claire" > 我的代码是: var lastname = record[1]; var firstname = record[2]; var fullnames = lastname+ ', ' + firstname; var newRow = "<tr data-providernum=" + providerNum + " data-providername=" + fullnames + "><td>" + providerNum + "</td><td>" + lastname + "</td><td>" + firstname + "</td></tr>"; $("#searchresult").append(newRow); 我尝试过双引号和单引号的不同组合来构建我的字符串,但现在我只是在旋转我的轮子。 我如何实现这一目标? 使用 jQuery 的创建方法创建 HTML 元素而不是字符串 const newRow = $("<tr>", { "data-providernum": providerNum, "data-providername": fullnames, }).append( $("<td>", { text: providerNum }), $("<td>", { text: lastname }), $("<td>", { text: firstname }), );

回答 1 投票 0

.net 中的记录器屏幕

我有网站豁免系统,当用户打开网站记录会话并将视频保存到 wwwroot 时,以及当完成会话结束视频时,我想要在 JavaScript 或 C# 中使用 项目:asp mvc核心 当完成...

回答 1 投票 0

无法使用 jQuery 更新 React 渲染的 DOM 类

我尝试过的: 尝试使用 jQuery 更新 React 组件渲染的 DOM 中的类。 通过检查它们的长度来验证我所针对的类是否存在于 DOM 中,这 包括...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.