问题标签 [livequery]

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 投票
0 回答
144 浏览

javascript - jQuery livequery - 清理函数何时不应该触发?

我有以下代码,它应该根据文档中的实际表存在设置main_table_on_page变量...

...但是,清理函数(第二个)在第一个函数之后直接触发,导致main_table_on_page始终设置为false。当我更改我的主要内容 DIV 元素(通过 AJAX)的内容时会触发这些函数,该元素可能包含也可能不包含表格。

有任何想法吗?:)

0 投票
1 回答
1618 浏览

jquery - AjaxUpload:为什么我必须点击两次?

下面的代码使用 AjaxUpload.2.0.min.js 将文件上传到服务器

但是您需要多次单击“添加文件”按钮才能显示操作系统窗口(选择要上传的文件的位置),而不是单击一次。

此外,如果您在链接中单击一次,然后将鼠标移出红色区域并单击(在#upload_files 之外),最后您在链接中单击返回,它可以工作,操作系统窗口打开.. 但是为什么我必须这样做吗?AjaxUpload 最初不会绑定在 .livequery 调用中吗?那么,我该如何绑定呢?

请专注于这一点,在操作系统窗口上通过鼠标的第一次点击显示。其余的编程在我的服务器上运行良好。

.js 被上传到 github 以使代码易于测试,但实际上它们在我的机器中。

非常感谢

0 投票
1 回答
519 浏览

javascript - 实时查询按键事件

(我使用before()jquery 中的函数将新<p>元素附加到 div 层。



在这里,我设置keypress了插入<br>标签的功能。


这工作正常(br 标记插入),直到调用 append 函数并<p>添加一个新函数。如何让 livequery 取消绑定按键事件并再次绑定?


编辑:标签<p>具有contentEditable属性。我这样做是因为<br>标签包含在 div 中,我只想要<br>标签

0 投票
1 回答
1809 浏览

jquery - livequery not working with groups

I am using some nice plugins from jQuery for using AJAX based sites. Now I came to the problem that I would like to use livequery for specifying my slimbox. The problem is, that it doesn't get my groups as stated in the linkFiler function.

What's going wrong? In one of my pages (Biography), the slimbox only works when I refresh the page on that site, but not when clicking through my pages. The groups aren't working in the Discography section of the site.

Parts of the bio and discography pictures are as follows:

Thanks in advance!

UPDATE

I found my problem in the slimbox code, because it uses the this to be its links. So everytime livequery is fired, the this is overwritten and should actually contain the full selector. Maybe I can solve this by just saying:

But doing that would make livequery fire a lot of times towards slimbox, which is not wanted behaviour. Is there a nicer way to make it not fire so often?

UPDATE2

As for the other questio in the biography pages. livequery updates on removing the image, but all the other sites are done properly on adding the images... How strange...

0 投票
1 回答
4645 浏览

jquery - 实时查询性能

我最近发现jQuery 的 livequery 插件可能非常浪费,因为它不使用事件委托,而是绑定所有可绑定事件并在每次更改时重新检查整个 DOM

如果有人对使用 livequery 和 .live() 的最佳实践有更多信息或建议,我将不胜感激

0 投票
3 回答
1163 浏览

javascript - 实时查询停止工作

这一直有效,直到几天前。只是突然停了下来。在添加带有“上下文菜单”类的新元素时,什么也没有发生。

尽管在萤火虫中,如果我运行上述语句,则会发现它并引发警报。

知道问题可能是什么吗?

HTML:

0 投票
2 回答
1794 浏览

jquery - jQuery & livequery - 检查函数是否已附加到元素

我正在运行这个:

blah()看起来像这样:

html看起来像:

所以我要做的是将该函数和事件附加到不在内部的每个输入元素上#boo。这行得通,但问题是它像每秒一样一遍又一遍地进行,并且浏览器冻结了。

我需要 livequery,因为 html 有时会更新,我需要再次将事件附加到新元素。

那么如何检查是否blah()已经应用于输入元素并停在那里?

0 投票
2 回答
572 浏览

javascript - jQuery 附加 html

如何在此追加上运行 livequery?

我的图像上有http://fancybox.net,试图为附加的 html 执行它。

0 投票
1 回答
249 浏览

jquery - 如何使这个 jquery 函数更简洁?

我在我的 asp.net 项目中的一个通用 javascript 文件中有此代码。

每当我将鼠标悬停在受此函数影响的按钮之一上时,jQuery-Lint 都会返回“您多次使用相同的选择器”。

此处提出了类似的问题。

0 投票
2 回答
718 浏览

jquery - 在 jquery 更新 DOM(AJAX 请求)之后做某事

我有一些更新页面内容的实时查询处理程序。我只想在他们被解雇后才显示内容(以防止用户暂时看到未更改的版本)。使用普通 AJAX 加载内容。

到目前为止,我尝试了以下方法:

  1. 通过html获取ajax
  2. 使其不可见(可见性:隐藏)
  3. window.setTimeout(showContent, 100) - 将可见性设置为可见

我认为这会起作用,因为单个选项卡有一个 JS 线程 - 所以计时器应该在所有其他操作完成后触发。它适用于 FF 和 IE。但是在 Chrome 中,有时我仍然会看到一段时间内未更改的内容 - 好像 JS 被线程化或被超时中断?

或者也许有更好的方法来实现我想要做的事情?(没有超时)。